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

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: Removed ET_SCROLL_FLING_CANCEL handling from TransparentButton and removed WindowSelector.MultiWind… Created 5 years, 12 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
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 e0cf9776e9cbe09039d7aafdd716cc5d22ce2735..df3af61f2633ebb5f80fa841aec1a411a997c702 100644
--- a/ash/wm/overview/scoped_overview_animation_settings.cc
+++ b/ash/wm/overview/scoped_overview_animation_settings.cc
@@ -23,6 +23,7 @@ const int kFadeInMilliseconds = 80;
base::TimeDelta GetAnimationDuration(OverviewAnimationType animation_type) {
switch (animation_type) {
case OVERVIEW_ANIMATION_NONE:
+ case SELECTOR_ITEM_SCROLL:
return base::TimeDelta();
case OVERVIEW_ANIMATION_ENTER_OVERVIEW_MODE_FADE_IN:
return base::TimeDelta::FromMilliseconds(kFadeInMilliseconds);
@@ -30,6 +31,8 @@ base::TimeDelta GetAnimationDuration(OverviewAnimationType animation_type) {
case OVERVIEW_ANIMATION_RESTORE_WINDOW:
case OVERVIEW_ANIMATION_HIDE_WINDOW:
return base::TimeDelta::FromMilliseconds(kTransitionMilliseconds);
+ case SELECTOR_ITEM_SCROLL_CANCEL:
+ return base::TimeDelta::FromMilliseconds(kTransitionMilliseconds);
}
NOTREACHED();
return base::TimeDelta();
@@ -44,6 +47,7 @@ ScopedOverviewAnimationSettings::ScopedOverviewAnimationSettings(
switch (animation_type) {
case OVERVIEW_ANIMATION_NONE:
+ case SELECTOR_ITEM_SCROLL:
animation_settings_.SetPreemptionStrategy(
ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS);
break;
@@ -65,6 +69,11 @@ ScopedOverviewAnimationSettings::ScopedOverviewAnimationSettings(
animation_settings_.SetPreemptionStrategy(
ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
break;
+ case SELECTOR_ITEM_SCROLL_CANCEL:
+ 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));

Powered by Google App Engine
This is Rietveld 408576698