Roll src/third_party/WebKit 6bc4103:c61006c (svn 202175:202177)
[chromium-blink-merge.git] / ash / shell_delegate.h
blob5e1c3a2ddac1b7629cbd7f0778a63f9ecf9dc3a3
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef ASH_SHELL_DELEGATE_H_
6 #define ASH_SHELL_DELEGATE_H_
8 #include <string>
10 #include "ash/ash_export.h"
11 #include "ash/shell.h"
12 #include "base/callback.h"
13 #include "base/strings/string16.h"
15 namespace app_list {
16 class AppListViewDelegate;
19 namespace aura {
20 class RootWindow;
21 class Window;
24 namespace content {
25 class BrowserContext;
28 namespace gfx {
29 class Image;
32 namespace ui {
33 class MenuModel;
36 namespace views {
37 class Widget;
40 namespace keyboard {
41 class KeyboardControllerProxy;
44 namespace ash {
46 class AccessibilityDelegate;
47 class MediaDelegate;
48 class NewWindowDelegate;
49 class SessionStateDelegate;
50 class ShelfDelegate;
51 class ShelfItemDelegate;
52 class ShelfModel;
53 class SystemTrayDelegate;
54 class UserWallpaperDelegate;
55 struct ShelfItem;
57 class ASH_EXPORT VirtualKeyboardStateObserver {
58 public:
59 // Called when keyboard is activated/deactivated.
60 virtual void OnVirtualKeyboardStateChanged(bool activated) {}
62 protected:
63 virtual ~VirtualKeyboardStateObserver() {}
66 // Delegate of the Shell.
67 class ASH_EXPORT ShellDelegate {
68 public:
69 // The Shell owns the delegate.
70 virtual ~ShellDelegate() {}
72 // Returns true if this is the first time that the shell has been run after
73 // the system has booted. false is returned after the shell has been
74 // restarted, typically due to logging in as a guest or logging out.
75 virtual bool IsFirstRunAfterBoot() const = 0;
77 // Returns true if multi-profiles feature is enabled.
78 virtual bool IsMultiProfilesEnabled() const = 0;
80 // Returns true if incognito mode is allowed for the user.
81 // Incognito windows are restricted for supervised users.
82 virtual bool IsIncognitoAllowed() const = 0;
84 // Returns true if we're running in forced app mode.
85 virtual bool IsRunningInForcedAppMode() const = 0;
87 // Returns true if multi account is enabled.
88 virtual bool IsMultiAccountEnabled() const = 0;
90 // Returns true if the first window shown on first run should be
91 // unconditionally maximized, overriding the heuristic that normally chooses
92 // the window size.
93 virtual bool IsForceMaximizeOnFirstRun() const = 0;
95 // Called before processing |Shell::Init()| so that the delegate
96 // can perform tasks necessary before the shell is initialized.
97 virtual void PreInit() = 0;
99 // Called at the beginninig of Shell destructor so that
100 // delegate can use Shell instance to perform cleanup tasks.
101 virtual void PreShutdown() = 0;
103 // Invoked when the user uses Ctrl-Shift-Q to close chrome.
104 virtual void Exit() = 0;
106 // Create a shell-specific keyboard::KeyboardControllerProxy
107 virtual keyboard::KeyboardControllerProxy*
108 CreateKeyboardControllerProxy() = 0;
110 // Called when virtual keyboard has been activated/deactivated.
111 virtual void VirtualKeyboardActivated(bool activated) = 0;
113 // Adds or removes virtual keyboard state observer.
114 virtual void AddVirtualKeyboardStateObserver(
115 VirtualKeyboardStateObserver* observer) = 0;
116 virtual void RemoveVirtualKeyboardStateObserver(
117 VirtualKeyboardStateObserver* observer) = 0;
119 // Get the active browser context. This will get us the active profile
120 // in chrome.
121 virtual content::BrowserContext* GetActiveBrowserContext() = 0;
123 // Get the AppListViewDelegate, creating one if it does not yet exist.
124 // Ownership stays with Chrome's AppListService, or the ShellDelegate.
125 virtual app_list::AppListViewDelegate* GetAppListViewDelegate() = 0;
127 // Creates a new ShelfDelegate. Shell takes ownership of the returned
128 // value.
129 virtual ShelfDelegate* CreateShelfDelegate(ShelfModel* model) = 0;
131 // Creates a system-tray delegate. Shell takes ownership of the delegate.
132 virtual SystemTrayDelegate* CreateSystemTrayDelegate() = 0;
134 // Creates a user wallpaper delegate. Shell takes ownership of the delegate.
135 virtual UserWallpaperDelegate* CreateUserWallpaperDelegate() = 0;
137 // Creates a session state delegate. Shell takes ownership of the delegate.
138 virtual SessionStateDelegate* CreateSessionStateDelegate() = 0;
140 // Creates a accessibility delegate. Shell takes ownership of the delegate.
141 virtual AccessibilityDelegate* CreateAccessibilityDelegate() = 0;
143 // Creates an application delegate. Shell takes ownership of the delegate.
144 virtual NewWindowDelegate* CreateNewWindowDelegate() = 0;
146 // Creates a media delegate. Shell takes ownership of the delegate.
147 virtual MediaDelegate* CreateMediaDelegate() = 0;
149 // Creates a menu model of the context for the |root_window|.
150 // When a ContextMenu is used for an item created by ShelfWindowWatcher,
151 // passes its ShelfItemDelegate and ShelfItem.
152 virtual ui::MenuModel* CreateContextMenu(
153 aura::Window* root_window,
154 ash::ShelfItemDelegate* item_delegate,
155 ash::ShelfItem* item) = 0;
157 // Creates a GPU support object. Shell takes ownership of the object.
158 virtual GPUSupport* CreateGPUSupport() = 0;
160 // Get the product name.
161 virtual base::string16 GetProductName() const = 0;
163 virtual void OpenKeyboardShortcutHelpPage() const {}
165 virtual gfx::Image GetDeprecatedAcceleratorImage() const = 0;
168 } // namespace ash
170 #endif // ASH_SHELL_DELEGATE_H_