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

Unified Diff: ash/wm/gestures/two_finger_drag_handler.cc

Issue 23471004: Only support left/right maximizing at 50% width when the --ash-enable-alternate-caption-button (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch is now friendlier to pending docking changes Created 7 years, 4 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/gestures/two_finger_drag_handler.cc
diff --git a/ash/wm/gestures/two_finger_drag_handler.cc b/ash/wm/gestures/two_finger_drag_handler.cc
index 49f7ecc02dd530562bc4ea759a95a19b28e0197a..bde37ed9969534ff71aa6bef6427db437bc6c22e 100644
--- a/ash/wm/gestures/two_finger_drag_handler.cc
+++ b/ash/wm/gestures/two_finger_drag_handler.cc
@@ -142,14 +142,17 @@ bool TwoFingerDragHandler::ProcessGestureEvent(aura::Window* target,
} else if (event.details().swipe_down() &&
wm::CanMinimizeWindow(target)) {
wm::MinimizeWindow(target);
- } else if (wm::CanSnapWindow(target)) {
- ui::ScopedLayerAnimationSettings scoped_setter(
- target->layer()->GetAnimator());
- scoped_setter.SetPreemptionStrategy(
- ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS);
- internal::SnapSizer::SnapWindow(target,
- event.details().swipe_left() ? internal::SnapSizer::LEFT_EDGE :
- internal::SnapSizer::RIGHT_EDGE);
+ } else {
+ using internal::SnapSizer;
+ SnapSizer::Edge edge = event.details().swipe_left() ?
+ SnapSizer::LEFT_EDGE : SnapSizer::RIGHT_EDGE;
+ if (SnapSizer::CanSnapWindow(target, edge)) {
+ ui::ScopedLayerAnimationSettings scoped_setter(
+ target->layer()->GetAnimator());
+ scoped_setter.SetPreemptionStrategy(
+ ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS);
+ SnapSizer::SnapWindow(target, edge, SnapSizer::STEP_NO);
+ }
}
return true;
}

Powered by Google App Engine
This is Rietveld 408576698