InProcessCommandBuffer: Update state in GetLastToken()
[chromium-blink-merge.git] / ash / shell_delegate.h
blob2bf08c176640b2a04a8029b28f7e0ece495c1c71
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/magnifier/magnifier_constants.h"
12 #include "ash/shell.h"
13 #include "base/callback.h"
14 #include "base/strings/string16.h"
15 #include "base/time/time.h"
17 namespace app_list {
18 class AppListViewDelegate;
21 namespace aura {
22 class RootWindow;
23 class Window;
24 namespace client {
25 class UserActionClient;
29 namespace ui {
30 class MenuModel;
33 namespace views {
34 class Widget;
37 namespace keyboard {
38 class KeyboardControllerProxy;
41 namespace ash {
43 class CapsLockDelegate;
44 class LauncherDelegate;
45 class LauncherModel;
46 struct LauncherItem;
47 class RootWindowHostFactory;
48 class SessionStateDelegate;
49 class SystemTrayDelegate;
50 class UserWallpaperDelegate;
52 enum UserMetricsAction {
53 UMA_ACCEL_KEYBOARD_BRIGHTNESS_DOWN_F6,
54 UMA_ACCEL_KEYBOARD_BRIGHTNESS_UP_F7,
55 UMA_ACCEL_LOCK_SCREEN_L,
56 UMA_ACCEL_LOCK_SCREEN_LOCK_BUTTON,
57 UMA_ACCEL_LOCK_SCREEN_POWER_BUTTON,
58 UMA_ACCEL_FULLSCREEN_F4,
59 UMA_ACCEL_MAXIMIZE_RESTORE_F4,
60 UMA_ACCEL_NEWTAB_T,
61 UMA_ACCEL_NEXTWINDOW_F5,
62 UMA_ACCEL_NEXTWINDOW_TAB,
63 UMA_ACCEL_OVERVIEW_F5,
64 UMA_ACCEL_PREVWINDOW_F5,
65 UMA_ACCEL_PREVWINDOW_TAB,
66 UMA_ACCEL_EXIT_FIRST_Q,
67 UMA_ACCEL_EXIT_SECOND_Q,
68 UMA_ACCEL_SEARCH_LWIN,
69 UMA_ACCEL_SHUT_DOWN_POWER_BUTTON,
70 UMA_CLOSE_THROUGH_CONTEXT_MENU,
71 UMA_LAUNCHER_CLICK_ON_APP,
72 UMA_LAUNCHER_CLICK_ON_APPLIST_BUTTON,
73 UMA_MINIMIZE_PER_KEY,
74 UMA_MOUSE_DOWN,
75 UMA_TOGGLE_MAXIMIZE_CAPTION_CLICK,
76 UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE,
77 UMA_TOUCHSCREEN_TAP_DOWN,
78 UMA_TRAY_HELP,
79 UMA_TRAY_LOCK_SCREEN,
80 UMA_TRAY_SHUT_DOWN,
81 UMA_WINDOW_APP_CLOSE_BUTTON_CLICK,
82 UMA_WINDOW_CLOSE_BUTTON_CLICK,
83 UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_EXIT_FULLSCREEN,
84 UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MAXIMIZE,
85 UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MINIMIZE,
86 UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_RESTORE,
87 UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE,
88 UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_LEFT,
89 UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT,
90 UMA_WINDOW_MAXIMIZE_BUTTON_MINIMIZE,
91 UMA_WINDOW_MAXIMIZE_BUTTON_RESTORE,
92 UMA_WINDOW_MAXIMIZE_BUTTON_SHOW_BUBBLE,
95 enum AccessibilityNotificationVisibility {
96 A11Y_NOTIFICATION_NONE,
97 A11Y_NOTIFICATION_SHOW,
100 // Delegate of the Shell.
101 class ASH_EXPORT ShellDelegate {
102 public:
103 // The Shell owns the delegate.
104 virtual ~ShellDelegate() {}
106 // Returns true if this is the first time that the shell has been run after
107 // the system has booted. false is returned after the shell has been
108 // restarted, typically due to logging in as a guest or logging out.
109 virtual bool IsFirstRunAfterBoot() const = 0;
111 // Returns true if multi-profiles feature is enabled.
112 virtual bool IsMultiProfilesEnabled() const = 0;
114 // Returns true if we're running in forced app mode.
115 virtual bool IsRunningInForcedAppMode() const = 0;
117 // Called before processing |Shell::Init()| so that the delegate
118 // can perform tasks necessary before the shell is initialized.
119 virtual void PreInit() = 0;
121 // Shuts down the environment.
122 virtual void Shutdown() = 0;
124 // Invoked when the user uses Ctrl-Shift-Q to close chrome.
125 virtual void Exit() = 0;
127 // Invoked when the user uses Ctrl+T to open a new tab.
128 virtual void NewTab() = 0;
130 // Invoked when the user uses Ctrl-N or Ctrl-Shift-N to open a new window.
131 virtual void NewWindow(bool incognito) = 0;
133 // Invoked when the user uses Shift+F4 to toggle the window fullscreen state.
134 virtual void ToggleFullscreen() = 0;
136 // Invoked when the user uses F4 to toggle window maximized state.
137 virtual void ToggleMaximized() = 0;
139 // Invoked when an accelerator is used to open the file manager.
140 virtual void OpenFileManager(bool as_dialog) = 0;
142 // Invoked when the user opens Crosh.
143 virtual void OpenCrosh() = 0;
145 // Invoked when the user uses Shift+Ctrl+T to restore the closed tab.
146 virtual void RestoreTab() = 0;
148 // Shows the keyboard shortcut overlay.
149 virtual void ShowKeyboardOverlay() = 0;
151 // Create a shell-specific keyboard::KeyboardControllerProxy
152 virtual keyboard::KeyboardControllerProxy*
153 CreateKeyboardControllerProxy() = 0;
155 // Shows the task manager window.
156 virtual void ShowTaskManager() = 0;
158 // Get the current browser context. This will get us the current profile.
159 virtual content::BrowserContext* GetCurrentBrowserContext() = 0;
161 // Invoked to toggle spoken feedback for accessibility
162 virtual void ToggleSpokenFeedback(
163 AccessibilityNotificationVisibility notify) = 0;
165 // Returns true if spoken feedback is enabled.
166 virtual bool IsSpokenFeedbackEnabled() const = 0;
168 // Invoked to toggle high contrast for accessibility.
169 virtual void ToggleHighContrast() = 0;
171 // Returns true if high contrast mode is enabled.
172 virtual bool IsHighContrastEnabled() const = 0;
174 // Invoked to enable the screen magnifier.
175 virtual void SetMagnifierEnabled(bool enabled) = 0;
177 // Invoked to change the type of the screen magnifier.
178 virtual void SetMagnifierType(MagnifierType type) = 0;
180 // Returns if the screen magnifier is enabled or not.
181 virtual bool IsMagnifierEnabled() const = 0;
183 // Returns the current screen magnifier mode.
184 virtual MagnifierType GetMagnifierType() const = 0;
186 // Invoked to enable Large Cursor.
187 virtual void SetLargeCursorEnabled(bool enabled) = 0;
189 // Returns if Large Cursor is enabled or not.
190 virtual bool IsLargeCursorEnabled() const = 0;
192 // Returns true if the user want to show accesibility menu even when all the
193 // accessibility features are disabled.
194 virtual bool ShouldAlwaysShowAccessibilityMenu() const = 0;
196 // Cancel all current and queued speech immediately.
197 virtual void SilenceSpokenFeedback() const = 0;
199 // Invoked to create an AppListViewDelegate. Shell takes the ownership of
200 // the created delegate.
201 virtual app_list::AppListViewDelegate* CreateAppListViewDelegate() = 0;
203 // Creates a new LauncherDelegate. Shell takes ownership of the returned
204 // value.
205 virtual LauncherDelegate* CreateLauncherDelegate(
206 ash::LauncherModel* model) = 0;
208 // Creates a system-tray delegate. Shell takes ownership of the delegate.
209 virtual SystemTrayDelegate* CreateSystemTrayDelegate() = 0;
211 // Creates a user wallpaper delegate. Shell takes ownership of the delegate.
212 virtual UserWallpaperDelegate* CreateUserWallpaperDelegate() = 0;
214 // Creates a caps lock delegate. Shell takes ownership of the delegate.
215 virtual CapsLockDelegate* CreateCapsLockDelegate() = 0;
217 // Creates a session state delegate. Shell takes ownership of the delegate.
218 virtual SessionStateDelegate* CreateSessionStateDelegate() = 0;
220 // Creates a user action client. Shell takes ownership of the object.
221 virtual aura::client::UserActionClient* CreateUserActionClient() = 0;
223 // Opens the feedback page for "Report Issue".
224 virtual void OpenFeedbackPage() = 0;
226 // Records that the user performed an action.
227 virtual void RecordUserMetricsAction(UserMetricsAction action) = 0;
229 // Handles the Next Track Media shortcut key.
230 virtual void HandleMediaNextTrack() = 0;
232 // Handles the Play/Pause Toggle Media shortcut key.
233 virtual void HandleMediaPlayPause() = 0;
235 // Handles the Previous Track Media shortcut key.
236 virtual void HandleMediaPrevTrack() = 0;
238 // Produces l10n-ed text of remaining time, e.g.: "13 minutes left" or
239 // "13 Minuten links".
240 // Used, for example, to display the remaining battery life.
241 virtual base::string16 GetTimeRemainingString(base::TimeDelta delta) = 0;
243 // Produces l10n-ed text for time duration, e.g.: "13 minutes" or "2 hours".
244 virtual base::string16 GetTimeDurationLongString(base::TimeDelta delta) = 0;
246 // Saves the zoom scale of the full screen magnifier.
247 virtual void SaveScreenMagnifierScale(double scale) = 0;
249 // Gets a saved value of the zoom scale of full screen magnifier. If a value
250 // is not saved, return a negative value.
251 virtual double GetSavedScreenMagnifierScale() = 0;
253 // Creates a menu model of the context for the |root_window|.
254 virtual ui::MenuModel* CreateContextMenu(aura::RootWindow* root_window) = 0;
256 // Creates a root window host factory. Shell takes ownership of the returned
257 // value.
258 virtual RootWindowHostFactory* CreateRootWindowHostFactory() = 0;
260 // Get the product name.
261 virtual base::string16 GetProductName() const = 0;
264 } // namespace ash
266 #endif // ASH_SHELL_DELEGATE_H_