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

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
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 09ef2634ed2a100c86703d9cc271a00e47614a5c..7d34fab9439d995996cfe0d52b6b4288e5dcc521 100644
--- a/ash/wm/toplevel_window_event_handler.cc
+++ b/ash/wm/toplevel_window_event_handler.cc
@@ -211,17 +211,12 @@ 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());
+ wm::SnapWindow(target, event->details().velocity_x() < 0 ?
+ internal::SnapSizer::LEFT_EDGE : internal::SnapSizer::RIGHT_EDGE);
}
break;
}

Powered by Google App Engine
This is Rietveld 408576698