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

Unified Diff: ash/wm/toplevel_window_event_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
« no previous file with comments | « ash/wm/gestures/two_finger_drag_handler.cc ('k') | ash/wm/toplevel_window_event_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/toplevel_window_event_handler.cc
diff --git a/ash/wm/toplevel_window_event_handler.cc b/ash/wm/toplevel_window_event_handler.cc
index d96127eff03d8e8d419bbf2184b1e2791d0419c9..4f5ad28f44337b50f1ee1b37b843bbe7b93f4505 100644
--- a/ash/wm/toplevel_window_event_handler.cc
+++ b/ash/wm/toplevel_window_event_handler.cc
@@ -214,17 +214,13 @@ ui::EventResult ToplevelWindowEventHandler::OnGestureEvent(
} else if (fabs(event->details().velocity_x()) >
kMinHorizVelocityForWindowSwipe) {
// Snap left/right.
- internal::SnapSizer sizer(target,
- gfx::Point(),
- event->details().velocity_x() < 0 ? 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());
+ internal::SnapSizer::SnapWindow(target,
+ event->details().velocity_x() < 0 ?
+ internal::SnapSizer::LEFT_EDGE : internal::SnapSizer::RIGHT_EDGE);
}
break;
}
« no previous file with comments | « ash/wm/gestures/two_finger_drag_handler.cc ('k') | ash/wm/toplevel_window_event_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698