Chromium Code Reviews| Index: ash/wm/session_state_controller_impl2.h |
| diff --git a/ash/wm/session_state_controller_impl2.h b/ash/wm/session_state_controller_impl2.h |
| index d5546795db2a2a002459a3c368d5b6ff9613a713..7d90c478b4134deb27c5e9bb2d38d72c641a5739 100644 |
| --- a/ash/wm/session_state_controller_impl2.h |
| +++ b/ash/wm/session_state_controller_impl2.h |
| @@ -42,9 +42,6 @@ class ASH_EXPORT SessionStateControllerImpl2 : public SessionStateController { |
| virtual ~TestApi(); |
| - bool lock_timer_is_running() const { |
| - return controller_->lock_timer_.IsRunning(); |
| - } |
| bool lock_fail_timer_is_running() const { |
| return controller_->lock_fail_timer_.IsRunning(); |
| } |
| @@ -57,11 +54,13 @@ class ASH_EXPORT SessionStateControllerImpl2 : public SessionStateController { |
| bool real_shutdown_timer_is_running() const { |
| return controller_->real_shutdown_timer_.IsRunning(); |
| } |
| - |
| - void trigger_lock_timeout() { |
| - controller_->OnLockTimeout(); |
| - controller_->lock_timer_.Stop(); |
| + bool is_animating_lock() const { |
| + return controller_->animating_lock_; |
| } |
| + bool is_lock_undoable() const { |
| + return controller_->undoable_lock_animation_; |
| + } |
| + |
| void trigger_lock_fail_timeout() { |
| controller_->OnLockFailTimeout(); |
| controller_->lock_fail_timer_.Stop(); |
| @@ -84,6 +83,10 @@ class ASH_EXPORT SessionStateControllerImpl2 : public SessionStateController { |
| DISALLOW_COPY_AND_ASSIGN(TestApi); |
| }; |
| + struct UnlockedStateProperties { |
|
sky
2012/12/12 20:35:56
Is there a reason you aren't using a bool directly
Denis Kuznetsov (DE-MUC)
2012/12/13 17:59:50
Yes, it seems that there would be similar paramete
|
| + bool background_is_hidden; |
| + }; |
| + |
| SessionStateControllerImpl2(); |
| virtual ~SessionStateControllerImpl2(); |
| @@ -123,12 +126,6 @@ class ASH_EXPORT SessionStateControllerImpl2 : public SessionStateController { |
| private: |
| void RequestShutdownImpl(); |
| - // Starts lock timer. |
| - void StartLockTimer(); |
| - |
| - // Requests that the screen be locked and starts |lock_fail_timer_|. |
| - void OnLockTimeout(); |
| - |
| // Reverts the pre-lock animation, reports the error. |
| void OnLockFailTimeout(); |
| @@ -145,14 +142,59 @@ class ASH_EXPORT SessionStateControllerImpl2 : public SessionStateController { |
| void OnPreShutdownAnimationTimeout(); |
| // Starts timer for final shutdown animation. |
| - void StartRealShutdownTimer(); |
| + // If |with_animation_time| is true, it will also include time of "fade to |
| + // white" shutdown animation. |
| + void StartRealShutdownTimer(bool with_animation_time); |
| // Requests that the machine be shut down. |
| void OnRealShutdownTimeout(); |
| + // Starts shutdown animation that can be cancelled and starts pre-shutdown |
| + // timer. |
| + void StartCancellableShutdownAnimation(); |
| + |
| + // Starts non-cancellable animation and starts real shutdown timer that |
| + // includes animation time. |
| + void StartShutdownAnimationImpl(); |
| + |
| // Triggers late animations on the lock screen. |
| void OnLockScreenAnimationFinished(); |
| + // Methods for initiating and checking different phases of |
| + // lock/unlock animations: |
| + // Lock phase one : windows lift (can be undone in some cases) |
| + // Lock phase two : lock screen raises |
| + // Unlock phase one : lock screen lowers |
| + // Unlock phase two : windows drop down |
| + |
| + void StartImmediateLockAnimationPhaseOne(); |
| + void StartUndoableLockAnimationPhaseOne(); |
| + void UndoLockAnimationPhaseOne(); |
| + void StartLockAnimationPhaseTwo(); |
| + // This method calls |callback| when animation completes. |
| + void StartUnlockAnimationPhaseOne(base::Closure &callback); |
| + void StartUnlockAnimationPhaseTwo(); |
| + |
| + // These methods are called when corresponding animation completes. |
| + void LockAnimationUndone(); |
| + void LockAnimationPhaseOneCompleted(); |
| + void LockAnimationPhaseTwoCompleted(); |
| + void UnlockAnimationPhaseTwoCompleted(); |
| + |
| + // Stores properties of UI that have to be temporary modified while locking. |
| + void StoreUnlockedProperties(); |
| + void RestoreUnlockedProperties(); |
| + |
| + // Fades in background layer with |speed| if it was hidden in unlocked state. |
| + void AnimateBackgroundAppearanceIfNecessary( |
| + ash::internal::SessionStateAnimator::AnimationSpeed speed, |
| + ui::LayerAnimationObserver* observer); |
| + |
| + // Fades out background layer with |speed| if it was hidden in unlocked state. |
| + void AnimateBackgroundHidingIfNecessary( |
| + ash::internal::SessionStateAnimator::AnimationSpeed speed, |
| + ui::LayerAnimationObserver* observer); |
| + |
| // The current login status, or original login status from before we locked. |
| user::LoginStatus login_status_; |
| @@ -166,10 +208,13 @@ class ASH_EXPORT SessionStateControllerImpl2 : public SessionStateController { |
| // locking. |
| bool shutdown_after_lock_; |
| - // Started when the user first presses the power button while in a |
| - // logged-in-as-a-non-guest-user, unlocked state. When it fires, we lock the |
| - // screen. |
| - base::OneShotTimer<SessionStateControllerImpl2> lock_timer_; |
| + // Indicates that controller displays lock animation. |
| + bool animating_lock_; |
| + |
| + // Indicates that lock animation can be undone. |
| + bool undoable_lock_animation_; |
|
sky
2012/12/12 20:35:56
can_stop_lock_animation_.
Denis Kuznetsov (DE-MUC)
2012/12/13 17:59:50
Done.
|
| + |
| + scoped_ptr<UnlockedStateProperties> unlocked_properties_; |
|
sky
2012/12/12 20:35:56
Why the scoped_ptr instead of by value?
Denis Kuznetsov (DE-MUC)
2012/12/13 17:59:50
One reason is that I want to have just another lay
|
| // Started when we request that the screen be locked. When it fires, we |
| // assume that our request got dropped. |