OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_LOCK_STATE_CONTROLLER_H_ | 5 #ifndef ASH_WM_LOCK_STATE_CONTROLLER_H_ |
6 #define ASH_WM_LOCK_STATE_CONTROLLER_H_ | 6 #define ASH_WM_LOCK_STATE_CONTROLLER_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/lock_state_observer.h" | 10 #include "ash/wm/lock_state_observer.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 controller_->real_shutdown_timer_.Stop(); | 136 controller_->real_shutdown_timer_.Stop(); |
137 } | 137 } |
138 | 138 |
139 private: | 139 private: |
140 LockStateController* controller_; // not owned | 140 LockStateController* controller_; // not owned |
141 | 141 |
142 DISALLOW_COPY_AND_ASSIGN(TestApi); | 142 DISALLOW_COPY_AND_ASSIGN(TestApi); |
143 }; | 143 }; |
144 | 144 |
145 LockStateController(); | 145 LockStateController(); |
146 virtual ~LockStateController(); | 146 ~LockStateController() override; |
147 | 147 |
148 void SetDelegate(scoped_ptr<LockStateControllerDelegate> delegate); | 148 void SetDelegate(scoped_ptr<LockStateControllerDelegate> delegate); |
149 | 149 |
150 void AddObserver(LockStateObserver* observer); | 150 void AddObserver(LockStateObserver* observer); |
151 void RemoveObserver(LockStateObserver* observer); | 151 void RemoveObserver(LockStateObserver* observer); |
152 bool HasObserver(LockStateObserver* observer); | 152 bool HasObserver(LockStateObserver* observer); |
153 | 153 |
154 // Starts locking (with slow animation) that can be cancelled. | 154 // Starts locking (with slow animation) that can be cancelled. |
155 // After locking and |kLockToShutdownTimeoutMs| StartShutdownAnimation() | 155 // After locking and |kLockToShutdownTimeoutMs| StartShutdownAnimation() |
156 // will be called unless CancelShutdownAnimation() is called, if | 156 // will be called unless CancelShutdownAnimation() is called, if |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // Called when ScreenLocker is ready to close, but not yet destroyed. | 193 // Called when ScreenLocker is ready to close, but not yet destroyed. |
194 // Can be used to display "hiding" animations on unlock. | 194 // Can be used to display "hiding" animations on unlock. |
195 // |callback| will be called when all animations are done. | 195 // |callback| will be called when all animations are done. |
196 void OnLockScreenHide(base::Closure& callback); | 196 void OnLockScreenHide(base::Closure& callback); |
197 | 197 |
198 // Sets up the callback that should be called once lock animation is finished. | 198 // Sets up the callback that should be called once lock animation is finished. |
199 // Callback is guaranteed to be called once and then discarded. | 199 // Callback is guaranteed to be called once and then discarded. |
200 void SetLockScreenDisplayedCallback(const base::Closure& callback); | 200 void SetLockScreenDisplayedCallback(const base::Closure& callback); |
201 | 201 |
202 // aura::WindowTreeHostObserver override: | 202 // aura::WindowTreeHostObserver override: |
203 virtual void OnHostCloseRequested(const aura::WindowTreeHost* host) override; | 203 void OnHostCloseRequested(const aura::WindowTreeHost* host) override; |
204 | 204 |
205 // ShellObserver overrides: | 205 // ShellObserver overrides: |
206 virtual void OnLoginStateChanged(user::LoginStatus status) override; | 206 void OnLoginStateChanged(user::LoginStatus status) override; |
207 virtual void OnAppTerminating() override; | 207 void OnAppTerminating() override; |
208 virtual void OnLockStateChanged(bool locked) override; | 208 void OnLockStateChanged(bool locked) override; |
209 | 209 |
210 void set_animator_for_test(SessionStateAnimator* animator) { | 210 void set_animator_for_test(SessionStateAnimator* animator) { |
211 animator_.reset(animator); | 211 animator_.reset(animator); |
212 } | 212 } |
213 | 213 |
214 private: | 214 private: |
215 friend class test::PowerButtonControllerTest; | 215 friend class test::PowerButtonControllerTest; |
216 friend class test::LockStateControllerTest; | 216 friend class test::LockStateControllerTest; |
217 | 217 |
218 struct UnlockedStateProperties { | 218 struct UnlockedStateProperties { |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 base::Closure lock_screen_displayed_callback_; | 326 base::Closure lock_screen_displayed_callback_; |
327 | 327 |
328 base::WeakPtrFactory<LockStateController> weak_ptr_factory_; | 328 base::WeakPtrFactory<LockStateController> weak_ptr_factory_; |
329 | 329 |
330 DISALLOW_COPY_AND_ASSIGN(LockStateController); | 330 DISALLOW_COPY_AND_ASSIGN(LockStateController); |
331 }; | 331 }; |
332 | 332 |
333 } // namespace ash | 333 } // namespace ash |
334 | 334 |
335 #endif // ASH_WM_LOCK_STATE_CONTROLLER_H_ | 335 #endif // ASH_WM_LOCK_STATE_CONTROLLER_H_ |
OLD | NEW |