diff options
author | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-09 16:48:33 +0000 |
---|---|---|
committer | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-09 16:48:33 +0000 |
commit | 5037b7ff5fab7bd48c34783704aba34198d8e7e5 (patch) | |
tree | dbabedcddc755bbc6f70248ed70f4aed485e92cd /ash | |
parent | 55af087ca369bd3201dcffd8fa86f0f0f5b39a8d (diff) | |
download | chromium_src-5037b7ff5fab7bd48c34783704aba34198d8e7e5.zip chromium_src-5037b7ff5fab7bd48c34783704aba34198d8e7e5.tar.gz chromium_src-5037b7ff5fab7bd48c34783704aba34198d8e7e5.tar.bz2 |
ash: Fix abort-shutdown animation.
This fixes a typo in SessionStateControllerImpl2 where the
wrong duration was being used for the
restore-brightness-and-grayscale animation displayed when
the user releases the power button before holding it long
enough to shut down (it was using 150 ms; this changes it to
500 ms).
It also corrects a similar typo in the undo-move-windows
animation (with no intended changes, though) and changes the
tween type for the abort-shutdown animation to make it less
flickery.
BUG=168793
Review URL: https://chromiumcodereview.appspot.com/11783032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175814 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/wm/session_state_animator.cc | 13 | ||||
-rw-r--r-- | ash/wm/session_state_controller_impl2.cc | 8 |
2 files changed, 11 insertions, 10 deletions
diff --git a/ash/wm/session_state_animator.cc b/ash/wm/session_state_animator.cc index 0f34b9d..82af8b3 100644 --- a/ash/wm/session_state_animator.cc +++ b/ash/wm/session_state_animator.cc @@ -246,6 +246,7 @@ void StartGrayscaleBrightnessAnimationForWindow( aura::Window* window, float target, base::TimeDelta duration, + ui::Tween::Type tween_type, ui::LayerAnimationObserver* observer) { ui::LayerAnimator* animator = window->layer()->GetAnimator(); @@ -257,13 +258,13 @@ void StartGrayscaleBrightnessAnimationForWindow( scoped_ptr<ui::LayerAnimationElement> brightness_element( ui::LayerAnimationElement::CreateBrightnessElement( target, duration)); - brightness_element->set_tween_type(ui::Tween::EASE_IN); + brightness_element->set_tween_type(tween_type); brightness_sequence->AddElement(brightness_element.release()); scoped_ptr<ui::LayerAnimationElement> grayscale_element( ui::LayerAnimationElement::CreateGrayscaleElement( target, duration)); - grayscale_element->set_tween_type(ui::Tween::EASE_IN); + grayscale_element->set_tween_type(tween_type); grayscale_sequence->AddElement(grayscale_element.release()); std::vector<ui::LayerAnimationSequence*> animations; @@ -439,11 +440,11 @@ base::TimeDelta SessionStateAnimator::GetDuration(AnimationSpeed speed) { case ANIMATION_SPEED_MOVE_WINDOWS: return base::TimeDelta::FromMilliseconds(350); case ANIMATION_SPEED_UNDO_MOVE_WINDOWS: - return base::TimeDelta::FromMilliseconds(500); + return base::TimeDelta::FromMilliseconds(350); case ANIMATION_SPEED_SHUTDOWN: return base::TimeDelta::FromMilliseconds(1000); case ANIMATION_SPEED_REVERT_SHUTDOWN: - return base::TimeDelta::FromMilliseconds(1500); + return base::TimeDelta::FromMilliseconds(500); } // Satisfy compilers that do not understand that we will return from switch // above anyway. @@ -603,11 +604,11 @@ void SessionStateAnimator::RunAnimationForWindow( break; case ANIMATION_GRAYSCALE_BRIGHTNESS: StartGrayscaleBrightnessAnimationForWindow( - window, 1.0, duration, observer); + window, 1.0, duration, ui::Tween::EASE_IN, observer); break; case ANIMATION_UNDO_GRAYSCALE_BRIGHTNESS: StartGrayscaleBrightnessAnimationForWindow( - window, 0.0, duration, observer); + window, 0.0, duration, ui::Tween::EASE_IN_OUT, observer); break; } } diff --git a/ash/wm/session_state_controller_impl2.cc b/ash/wm/session_state_controller_impl2.cc index 0eace76..c7a7135 100644 --- a/ash/wm/session_state_controller_impl2.cc +++ b/ash/wm/session_state_controller_impl2.cc @@ -264,7 +264,7 @@ void SessionStateControllerImpl2::CancelShutdownAnimation() { } animator_->StartGlobalAnimation( internal::SessionStateAnimator::ANIMATION_UNDO_GRAYSCALE_BRIGHTNESS, - internal::SessionStateAnimator::ANIMATION_SPEED_REVERT); + internal::SessionStateAnimator::ANIMATION_SPEED_REVERT_SHUTDOWN); pre_shutdown_timer_.Stop(); } @@ -500,15 +500,15 @@ void SessionStateControllerImpl2::CancelPreLockAnimation() { animator_->StartAnimationWithObserver( internal::SessionStateAnimator::NON_LOCK_SCREEN_CONTAINERS, internal::SessionStateAnimator::ANIMATION_UNDO_LIFT, - internal::SessionStateAnimator::ANIMATION_SPEED_MOVE_WINDOWS, + internal::SessionStateAnimator::ANIMATION_SPEED_UNDO_MOVE_WINDOWS, observer); animator_->StartAnimationWithObserver( internal::SessionStateAnimator::LAUNCHER, internal::SessionStateAnimator::ANIMATION_FADE_IN, - internal::SessionStateAnimator::ANIMATION_SPEED_MOVE_WINDOWS, + internal::SessionStateAnimator::ANIMATION_SPEED_UNDO_MOVE_WINDOWS, observer); AnimateBackgroundHidingIfNecessary( - internal::SessionStateAnimator::ANIMATION_SPEED_MOVE_WINDOWS, + internal::SessionStateAnimator::ANIMATION_SPEED_UNDO_MOVE_WINDOWS, observer); observer->Unpause(); |