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

Unified Diff: ash/wm/toplevel_window_event_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: Cleaned up unittests + varkha@'s suggestions 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/toplevel_window_event_handler.cc
diff --git a/ash/wm/toplevel_window_event_handler.cc b/ash/wm/toplevel_window_event_handler.cc
index a0d4b5e7e0b5b589c205c54c0c06f537e04466e9..b7cfcc080664b5bfed785c4f38c44065a7e8222a 100644
--- a/ash/wm/toplevel_window_event_handler.cc
+++ b/ash/wm/toplevel_window_event_handler.cc
@@ -301,7 +301,7 @@ void ToplevelWindowEventHandler::OnGestureEvent(ui::GestureEvent* event) {
SetRestoreBoundsInParent(target, pre_drag_window_bounds_);
wm::MaximizeWindow(target);
}
- } else if (wm::CanSnapWindow(target) &&
+ } else if (internal::SnapSizer::CanSnapWindow(target) &&
fabs(event->details().velocity_x()) >
kMinHorizVelocityForWindowSwipe) {
// Snap left/right.
@@ -309,9 +309,10 @@ void ToplevelWindowEventHandler::OnGestureEvent(ui::GestureEvent* event) {
target->layer()->GetAnimator());
scoped_setter.SetPreemptionStrategy(
ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS);
- internal::SnapSizer::SnapWindow(target,
- event->details().velocity_x() < 0 ?
- internal::SnapSizer::LEFT_EDGE : internal::SnapSizer::RIGHT_EDGE);
+ using internal::SnapSizer;
+ SnapSizer::Edge edge = event->details().velocity_x() < 0 ?
+ SnapSizer::LEFT_EDGE : SnapSizer::RIGHT_EDGE;
+ SnapSizer::SnapWindow(target, edge, SnapSizer::STEP_NO);
}
break;
}

Powered by Google App Engine
This is Rietveld 408576698