diff options
Diffstat (limited to 'ash/wm/overview/scoped_overview_animation_settings.cc')
-rw-r--r-- | ash/wm/overview/scoped_overview_animation_settings.cc | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/ash/wm/overview/scoped_overview_animation_settings.cc b/ash/wm/overview/scoped_overview_animation_settings.cc index 9dc172d..3cb6bcb 100644 --- a/ash/wm/overview/scoped_overview_animation_settings.cc +++ b/ash/wm/overview/scoped_overview_animation_settings.cc @@ -20,15 +20,22 @@ const int kTransitionMilliseconds = 200; // The time duration for widgets to fade in. const int kFadeInMilliseconds = 80; +// The time duration for widgets to fade out. +const int kFadeOutMilliseconds = 100; + base::TimeDelta GetAnimationDuration(OverviewAnimationType animation_type) { switch (animation_type) { case OVERVIEW_ANIMATION_NONE: + case OVERVIEW_ANIMATION_SCROLL_SELECTOR_ITEM: return base::TimeDelta(); case OVERVIEW_ANIMATION_ENTER_OVERVIEW_MODE_FADE_IN: return base::TimeDelta::FromMilliseconds(kFadeInMilliseconds); + case OVERVIEW_ANIMATION_ENTER_OVERVIEW_MODE_FADE_OUT: + return base::TimeDelta::FromMilliseconds(kFadeOutMilliseconds); case OVERVIEW_ANIMATION_LAY_OUT_SELECTOR_ITEMS: case OVERVIEW_ANIMATION_RESTORE_WINDOW: case OVERVIEW_ANIMATION_HIDE_WINDOW: + case OVERVIEW_ANIMATION_CANCEL_SELECTOR_ITEM_SCROLL: return base::TimeDelta::FromMilliseconds(kTransitionMilliseconds); } NOTREACHED(); @@ -44,6 +51,7 @@ ScopedOverviewAnimationSettings::ScopedOverviewAnimationSettings( switch (animation_type) { case OVERVIEW_ANIMATION_NONE: + case OVERVIEW_ANIMATION_SCROLL_SELECTOR_ITEM: animation_settings_.SetPreemptionStrategy( ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); break; @@ -55,6 +63,10 @@ ScopedOverviewAnimationSettings::ScopedOverviewAnimationSettings( animation_settings_.SetPreemptionStrategy( ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); break; + case OVERVIEW_ANIMATION_ENTER_OVERVIEW_MODE_FADE_OUT: + animation_settings_.SetPreemptionStrategy( + ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); + break; case OVERVIEW_ANIMATION_LAY_OUT_SELECTOR_ITEMS: case OVERVIEW_ANIMATION_RESTORE_WINDOW: animation_settings_.SetPreemptionStrategy( @@ -65,6 +77,11 @@ ScopedOverviewAnimationSettings::ScopedOverviewAnimationSettings( animation_settings_.SetPreemptionStrategy( ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); break; + case OVERVIEW_ANIMATION_CANCEL_SELECTOR_ITEM_SCROLL: + animation_settings_.SetPreemptionStrategy( + ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); + animation_settings_.SetTweenType(gfx::Tween::EASE_IN_OUT); + break; } animation_settings_.SetTransitionDuration( GetAnimationDuration(animation_type)); @@ -73,15 +90,4 @@ ScopedOverviewAnimationSettings::ScopedOverviewAnimationSettings( ScopedOverviewAnimationSettings::~ScopedOverviewAnimationSettings() { } -// static: -void ScopedOverviewAnimationSettings::SetupFadeInAfterLayout( - aura::Window* window) { - ui::Layer* layer = window->layer(); - layer->SetOpacity(0.0f); - ScopedOverviewAnimationSettings animation_settings( - OverviewAnimationType::OVERVIEW_ANIMATION_ENTER_OVERVIEW_MODE_FADE_IN, - window); - layer->SetOpacity(1.0f); -} - } // namespace ash |