| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 11 #include "ash/common/shell_observer.h" | 11 #include "ash/common/shell_observer.h" |
| 12 #include "ash/wm/lock_state_observer.h" | |
| 13 #include "ash/wm/session_state_animator.h" | 12 #include "ash/wm/session_state_animator.h" |
| 14 #include "base/macros.h" | 13 #include "base/macros.h" |
| 15 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 16 #include "base/observer_list.h" | |
| 17 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 18 #include "base/timer/elapsed_timer.h" | 16 #include "base/timer/elapsed_timer.h" |
| 19 #include "base/timer/timer.h" | 17 #include "base/timer/timer.h" |
| 20 #include "ui/aura/window_tree_host_observer.h" | 18 #include "ui/aura/window_tree_host_observer.h" |
| 21 | 19 |
| 22 namespace gfx { | 20 namespace gfx { |
| 23 class Rect; | 21 class Rect; |
| 24 class Size; | 22 class Size; |
| 25 } | 23 } |
| 26 | 24 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 LockStateController* controller_; // not owned | 137 LockStateController* controller_; // not owned |
| 140 | 138 |
| 141 DISALLOW_COPY_AND_ASSIGN(TestApi); | 139 DISALLOW_COPY_AND_ASSIGN(TestApi); |
| 142 }; | 140 }; |
| 143 | 141 |
| 144 LockStateController(); | 142 LockStateController(); |
| 145 ~LockStateController() override; | 143 ~LockStateController() override; |
| 146 | 144 |
| 147 void SetDelegate(std::unique_ptr<LockStateControllerDelegate> delegate); | 145 void SetDelegate(std::unique_ptr<LockStateControllerDelegate> delegate); |
| 148 | 146 |
| 149 void AddObserver(LockStateObserver* observer); | |
| 150 void RemoveObserver(LockStateObserver* observer); | |
| 151 bool HasObserver(const LockStateObserver* observer) const; | |
| 152 | |
| 153 // Starts locking (with slow animation) that can be cancelled. | 147 // Starts locking (with slow animation) that can be cancelled. |
| 154 // After locking and |kLockToShutdownTimeoutMs| StartShutdownAnimation() | 148 // After locking and |kLockToShutdownTimeoutMs| StartShutdownAnimation() |
| 155 // will be called unless CancelShutdownAnimation() is called, if | 149 // will be called unless CancelShutdownAnimation() is called, if |
| 156 // |shutdown_after_lock| is true. | 150 // |shutdown_after_lock| is true. |
| 157 void StartLockAnimation(bool shutdown_after_lock); | 151 void StartLockAnimation(bool shutdown_after_lock); |
| 158 | 152 |
| 159 // Starts shutting down (with slow animation) that can be cancelled. | 153 // Starts shutting down (with slow animation) that can be cancelled. |
| 160 void StartShutdownAnimation(); | 154 void StartShutdownAnimation(); |
| 161 | 155 |
| 162 // Starts usual lock animation, but locks immediately. After locking and | 156 // Starts usual lock animation, but locks immediately. After locking and |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 | 269 |
| 276 // Fades out background layer with |speed| if it was hidden in unlocked state. | 270 // Fades out background layer with |speed| if it was hidden in unlocked state. |
| 277 void AnimateBackgroundHidingIfNecessary( | 271 void AnimateBackgroundHidingIfNecessary( |
| 278 ash::SessionStateAnimator::AnimationSpeed speed, | 272 ash::SessionStateAnimator::AnimationSpeed speed, |
| 279 SessionStateAnimator::AnimationSequence* animation_sequence); | 273 SessionStateAnimator::AnimationSequence* animation_sequence); |
| 280 | 274 |
| 281 std::unique_ptr<SessionStateAnimator> animator_; | 275 std::unique_ptr<SessionStateAnimator> animator_; |
| 282 | 276 |
| 283 std::unique_ptr<LockStateControllerDelegate> delegate_; | 277 std::unique_ptr<LockStateControllerDelegate> delegate_; |
| 284 | 278 |
| 285 base::ObserverList<LockStateObserver> observers_; | |
| 286 | |
| 287 // The current login status, or original login status from before we locked. | 279 // The current login status, or original login status from before we locked. |
| 288 LoginStatus login_status_; | 280 LoginStatus login_status_; |
| 289 | 281 |
| 290 // Current lock status. | 282 // Current lock status. |
| 291 bool system_is_locked_; | 283 bool system_is_locked_; |
| 292 | 284 |
| 293 // Are we in the process of shutting the machine down? | 285 // Are we in the process of shutting the machine down? |
| 294 bool shutting_down_; | 286 bool shutting_down_; |
| 295 | 287 |
| 296 // Indicates whether controller should proceed to (cancellable) shutdown after | 288 // Indicates whether controller should proceed to (cancellable) shutdown after |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 base::Closure lock_screen_displayed_callback_; | 321 base::Closure lock_screen_displayed_callback_; |
| 330 | 322 |
| 331 base::WeakPtrFactory<LockStateController> weak_ptr_factory_; | 323 base::WeakPtrFactory<LockStateController> weak_ptr_factory_; |
| 332 | 324 |
| 333 DISALLOW_COPY_AND_ASSIGN(LockStateController); | 325 DISALLOW_COPY_AND_ASSIGN(LockStateController); |
| 334 }; | 326 }; |
| 335 | 327 |
| 336 } // namespace ash | 328 } // namespace ash |
| 337 | 329 |
| 338 #endif // ASH_WM_LOCK_STATE_CONTROLLER_H_ | 330 #endif // ASH_WM_LOCK_STATE_CONTROLLER_H_ |
| OLD | NEW |