Chromium Code Reviews| 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_WM_SESSION_STATE_CONTROLLER_IMPL_H_ | 5 #ifndef ASH_WM_SESSION_STATE_CONTROLLER_IMPL_H_ |
| 6 #define ASH_WM_SESSION_STATE_CONTROLLER_IMPL_H_ | 6 #define ASH_WM_SESSION_STATE_CONTROLLER_IMPL_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/shell_observer.h" | 9 #include "ash/shell_observer.h" |
| 10 #include "ash/wm/session_state_animator.h" | 10 #include "ash/wm/session_state_animator.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 | 89 |
| 90 // RootWindowObserver override: | 90 // RootWindowObserver override: |
| 91 virtual void OnRootWindowHostCloseRequested( | 91 virtual void OnRootWindowHostCloseRequested( |
| 92 const aura::RootWindow* root) OVERRIDE; | 92 const aura::RootWindow* root) OVERRIDE; |
| 93 | 93 |
| 94 // ShellObserver overrides: | 94 // ShellObserver overrides: |
| 95 virtual void OnLoginStateChanged(user::LoginStatus status) OVERRIDE; | 95 virtual void OnLoginStateChanged(user::LoginStatus status) OVERRIDE; |
| 96 virtual void OnAppTerminating() OVERRIDE; | 96 virtual void OnAppTerminating() OVERRIDE; |
| 97 virtual void OnLockStateChanged(bool locked) OVERRIDE; | 97 virtual void OnLockStateChanged(bool locked) OVERRIDE; |
| 98 | 98 |
| 99 // Returns true iff when we're in state when user session can be locked. | 99 // Returns true iff when we're in state when user session can be locked. |
|
Daniel Erat
2012/10/25 15:45:58
nit (doesn't need to be addressed in this change):
| |
| 100 virtual bool IsEligibleForLock() OVERRIDE; | 100 virtual bool IsEligibleForLock() OVERRIDE; |
| 101 | 101 |
| 102 // Returns true if system is locked. | 102 // Returns true if system is locked. |
| 103 virtual bool IsLocked() OVERRIDE; | 103 virtual bool IsLocked() OVERRIDE; |
| 104 | 104 |
| 105 // Starts locking (with slow animation) that can be cancelled. | 105 // Starts locking (with slow animation) that can be cancelled. |
| 106 // After locking and |kLockToShutdownTimeoutMs| StartShutdownAnimation() | 106 // After locking and |kLockToShutdownTimeoutMs| StartShutdownAnimation() |
| 107 // will be called unless CancelShutdownAnimation() is called, if | 107 // will be called unless CancelShutdownAnimation() is called, if |
| 108 // shutdown_after_lock is true. | 108 // shutdown_after_lock is true. |
| 109 virtual void StartLockAnimation(bool shutdown_after_lock) OVERRIDE; | 109 virtual void StartLockAnimation(bool shutdown_after_lock) OVERRIDE; |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 133 | 133 |
| 134 // Cancels shutting down and reverts shutdown animation. | 134 // Cancels shutting down and reverts shutdown animation. |
| 135 virtual void CancelShutdownAnimation() OVERRIDE; | 135 virtual void CancelShutdownAnimation() OVERRIDE; |
| 136 | 136 |
| 137 // Called when Chrome gets a request to display the lock screen. | 137 // Called when Chrome gets a request to display the lock screen. |
| 138 virtual void OnStartingLock() OVERRIDE; | 138 virtual void OnStartingLock() OVERRIDE; |
| 139 | 139 |
| 140 // Displays the shutdown animation and requests shutdown when it's done. | 140 // Displays the shutdown animation and requests shutdown when it's done. |
| 141 virtual void RequestShutdown() OVERRIDE; | 141 virtual void RequestShutdown() OVERRIDE; |
| 142 | 142 |
| 143 virtual void OnLockScreenHide(base::Callback<void(void)>& callback) OVERRIDE; | |
| 144 | |
| 143 protected: | 145 protected: |
| 144 friend class test::PowerButtonControllerTest; | 146 friend class test::PowerButtonControllerTest; |
| 145 | 147 |
| 146 bool IsLoggedInAsNonGuest() const; | 148 bool IsLoggedInAsNonGuest() const; |
| 147 | 149 |
| 148 private: | 150 private: |
| 149 void RequestShutdownImpl(); | 151 void RequestShutdownImpl(); |
| 150 | 152 |
| 151 // Starts lock timer. | 153 // Starts lock timer. |
| 152 void StartLockTimer(); | 154 void StartLockTimer(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 210 // request shutdown. Gives the animation time to complete before Chrome, X, | 212 // request shutdown. Gives the animation time to complete before Chrome, X, |
| 211 // etc. are shut down. | 213 // etc. are shut down. |
| 212 base::OneShotTimer<SessionStateControllerImpl> real_shutdown_timer_; | 214 base::OneShotTimer<SessionStateControllerImpl> real_shutdown_timer_; |
| 213 | 215 |
| 214 DISALLOW_COPY_AND_ASSIGN(SessionStateControllerImpl); | 216 DISALLOW_COPY_AND_ASSIGN(SessionStateControllerImpl); |
| 215 }; | 217 }; |
| 216 | 218 |
| 217 } // namespace ash | 219 } // namespace ash |
| 218 | 220 |
| 219 #endif // ASH_WM_SESSION_STATE_CONTROLLER_IMPL_H_ | 221 #endif // ASH_WM_SESSION_STATE_CONTROLLER_IMPL_H_ |
| OLD | NEW |