OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_SHELL_DELEGATE_H_ | 5 #ifndef ASH_SHELL_DELEGATE_H_ |
6 #define ASH_SHELL_DELEGATE_H_ | 6 #define ASH_SHELL_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 class KeyboardControllerProxy; | 38 class KeyboardControllerProxy; |
39 } | 39 } |
40 | 40 |
41 namespace ash { | 41 namespace ash { |
42 | 42 |
43 class CapsLockDelegate; | 43 class CapsLockDelegate; |
44 class LauncherDelegate; | 44 class LauncherDelegate; |
45 class LauncherModel; | 45 class LauncherModel; |
46 struct LauncherItem; | 46 struct LauncherItem; |
47 class RootWindowHostFactory; | 47 class RootWindowHostFactory; |
48 class SessionStateDelegate; | |
49 class SystemTrayDelegate; | 48 class SystemTrayDelegate; |
50 class UserWallpaperDelegate; | 49 class UserWallpaperDelegate; |
51 | 50 |
52 enum UserMetricsAction { | 51 enum UserMetricsAction { |
53 UMA_ACCEL_KEYBOARD_BRIGHTNESS_DOWN_F6, | 52 UMA_ACCEL_KEYBOARD_BRIGHTNESS_DOWN_F6, |
54 UMA_ACCEL_KEYBOARD_BRIGHTNESS_UP_F7, | 53 UMA_ACCEL_KEYBOARD_BRIGHTNESS_UP_F7, |
55 UMA_ACCEL_LOCK_SCREEN_L, | 54 UMA_ACCEL_LOCK_SCREEN_L, |
56 UMA_ACCEL_LOCK_SCREEN_LOCK_BUTTON, | 55 UMA_ACCEL_LOCK_SCREEN_LOCK_BUTTON, |
57 UMA_ACCEL_LOCK_SCREEN_POWER_BUTTON, | 56 UMA_ACCEL_LOCK_SCREEN_POWER_BUTTON, |
58 UMA_ACCEL_MAXIMIZE_RESTORE_F4, | 57 UMA_ACCEL_MAXIMIZE_RESTORE_F4, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 A11Y_NOTIFICATION_NONE, | 91 A11Y_NOTIFICATION_NONE, |
93 A11Y_NOTIFICATION_SHOW, | 92 A11Y_NOTIFICATION_SHOW, |
94 }; | 93 }; |
95 | 94 |
96 // Delegate of the Shell. | 95 // Delegate of the Shell. |
97 class ASH_EXPORT ShellDelegate { | 96 class ASH_EXPORT ShellDelegate { |
98 public: | 97 public: |
99 // The Shell owns the delegate. | 98 // The Shell owns the delegate. |
100 virtual ~ShellDelegate() {} | 99 virtual ~ShellDelegate() {} |
101 | 100 |
| 101 // Returns true if user has logged in. |
| 102 virtual bool IsUserLoggedIn() const = 0; |
| 103 |
| 104 // Returns true if we're logged in and browser has been started |
| 105 virtual bool IsSessionStarted() const = 0; |
| 106 |
| 107 // Returns true if we're logged in as guest. |
| 108 virtual bool IsGuestSession() const = 0; |
| 109 |
102 // Returns true if this is the first time that the shell has been run after | 110 // Returns true if this is the first time that the shell has been run after |
103 // the system has booted. false is returned after the shell has been | 111 // the system has booted. false is returned after the shell has been |
104 // restarted, typically due to logging in as a guest or logging out. | 112 // restarted, typically due to logging in as a guest or logging out. |
105 virtual bool IsFirstRunAfterBoot() const = 0; | 113 virtual bool IsFirstRunAfterBoot() const = 0; |
106 | 114 |
107 // Returns true if multi-profiles feature is enabled. | 115 // Returns true if multi-profiles feature is enabled. |
108 virtual bool IsMultiProfilesEnabled() const = 0; | 116 virtual bool IsMultiProfilesEnabled() const = 0; |
109 | 117 |
110 // Returns true if we're running in forced app mode. | 118 // Returns true if we're running in forced app mode. |
111 virtual bool IsRunningInForcedAppMode() const = 0; | 119 virtual bool IsRunningInForcedAppMode() const = 0; |
112 | 120 |
| 121 // Returns true if a user is logged in whose session can be locked (i.e. the |
| 122 // user has a password with which to unlock the session). |
| 123 virtual bool CanLockScreen() const = 0; |
| 124 |
| 125 // Invoked when a user locks the screen. |
| 126 virtual void LockScreen() = 0; |
| 127 |
| 128 // Unlock the screen. Currently used only for tests. |
| 129 virtual void UnlockScreen() = 0; |
| 130 |
| 131 // Returns true if the screen is currently locked. |
| 132 virtual bool IsScreenLocked() const = 0; |
| 133 |
113 // Called before processing |Shell::Init()| so that the delegate | 134 // Called before processing |Shell::Init()| so that the delegate |
114 // can perform tasks necessary before the shell is initialized. | 135 // can perform tasks necessary before the shell is initialized. |
115 virtual void PreInit() = 0; | 136 virtual void PreInit() = 0; |
116 | 137 |
117 // Shuts down the environment. | 138 // Shuts down the environment. |
118 virtual void Shutdown() = 0; | 139 virtual void Shutdown() = 0; |
119 | 140 |
120 // Invoked when the user uses Ctrl-Shift-Q to close chrome. | 141 // Invoked when the user uses Ctrl-Shift-Q to close chrome. |
121 virtual void Exit() = 0; | 142 virtual void Exit() = 0; |
122 | 143 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 219 |
199 // Creates a system-tray delegate. Shell takes ownership of the delegate. | 220 // Creates a system-tray delegate. Shell takes ownership of the delegate. |
200 virtual SystemTrayDelegate* CreateSystemTrayDelegate() = 0; | 221 virtual SystemTrayDelegate* CreateSystemTrayDelegate() = 0; |
201 | 222 |
202 // Creates a user wallpaper delegate. Shell takes ownership of the delegate. | 223 // Creates a user wallpaper delegate. Shell takes ownership of the delegate. |
203 virtual UserWallpaperDelegate* CreateUserWallpaperDelegate() = 0; | 224 virtual UserWallpaperDelegate* CreateUserWallpaperDelegate() = 0; |
204 | 225 |
205 // Creates a caps lock delegate. Shell takes ownership of the delegate. | 226 // Creates a caps lock delegate. Shell takes ownership of the delegate. |
206 virtual CapsLockDelegate* CreateCapsLockDelegate() = 0; | 227 virtual CapsLockDelegate* CreateCapsLockDelegate() = 0; |
207 | 228 |
208 // Creates a session state delegate. Shell takes ownership of the delegate. | |
209 virtual SessionStateDelegate* CreateSessionStateDelegate() = 0; | |
210 | |
211 // Creates a user action client. Shell takes ownership of the object. | 229 // Creates a user action client. Shell takes ownership of the object. |
212 virtual aura::client::UserActionClient* CreateUserActionClient() = 0; | 230 virtual aura::client::UserActionClient* CreateUserActionClient() = 0; |
213 | 231 |
214 // Opens the feedback page for "Report Issue". | 232 // Opens the feedback page for "Report Issue". |
215 virtual void OpenFeedbackPage() = 0; | 233 virtual void OpenFeedbackPage() = 0; |
216 | 234 |
217 // Records that the user performed an action. | 235 // Records that the user performed an action. |
218 virtual void RecordUserMetricsAction(UserMetricsAction action) = 0; | 236 virtual void RecordUserMetricsAction(UserMetricsAction action) = 0; |
219 | 237 |
220 // Handles the Next Track Media shortcut key. | 238 // Handles the Next Track Media shortcut key. |
(...skipping 27 matching lines...) Expand all Loading... |
248 // value. | 266 // value. |
249 virtual RootWindowHostFactory* CreateRootWindowHostFactory() = 0; | 267 virtual RootWindowHostFactory* CreateRootWindowHostFactory() = 0; |
250 | 268 |
251 // Get the product name. | 269 // Get the product name. |
252 virtual base::string16 GetProductName() const = 0; | 270 virtual base::string16 GetProductName() const = 0; |
253 }; | 271 }; |
254 | 272 |
255 } // namespace ash | 273 } // namespace ash |
256 | 274 |
257 #endif // ASH_SHELL_DELEGATE_H_ | 275 #endif // ASH_SHELL_DELEGATE_H_ |
OLD | NEW |