Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2238)

Unified Diff: ash/wm/overview/scoped_overview_animation_settings.cc

Issue 690103008: Implemented swipe to close in overview mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed flackr's comments from Patch Set 7. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/overview/scoped_overview_animation_settings.h ('k') | ash/wm/overview/window_selector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/overview/scoped_overview_animation_settings.cc
diff --git a/ash/wm/overview/scoped_overview_animation_settings.cc b/ash/wm/overview/scoped_overview_animation_settings.cc
index 9dc172d2dbb3011d22385bf495dd2d8aa58ee0ba..3cb6bcbcc8b047400752bc09ee76f5059fc0a8b4 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
« no previous file with comments | « ash/wm/overview/scoped_overview_animation_settings.h ('k') | ash/wm/overview/window_selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698