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

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

Issue 11434004: ash: Refactor some code that snaps windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 a450a273d9a9db0446db20ef118ac88da9dd3a59..4cdef56b22cafb7b77a490f955a99a87ad9c7909 100644
--- a/ash/wm/gestures/two_finger_drag_handler.cc
+++ b/ash/wm/gestures/two_finger_drag_handler.cc
@@ -133,17 +133,13 @@ bool TwoFingerDragHandler::ProcessGestureEvent(aura::Window* target,
} else if (event.details().swipe_down()) {
wm::MinimizeWindow(target);
} else {
- internal::SnapSizer sizer(target,
- gfx::Point(),
- event.details().swipe_left() ? internal::SnapSizer::LEFT_EDGE :
- internal::SnapSizer::RIGHT_EDGE,
- internal::SnapSizer::OTHER_INPUT);
-
ui::ScopedLayerAnimationSettings scoped_setter(
target->layer()->GetAnimator());
scoped_setter.SetPreemptionStrategy(
ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS);
- target->SetBounds(sizer.target_bounds());
+ wm::SnapWindow(target,
+ event.details().swipe_left() ? internal::SnapSizer::LEFT_EDGE :
+ internal::SnapSizer::RIGHT_EDGE);
}
return true;
}

Powered by Google App Engine
This is Rietveld 408576698