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

Unified Diff: ash/wm/gestures/system_pinch_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: 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/system_pinch_handler.cc
diff --git a/ash/wm/gestures/system_pinch_handler.cc b/ash/wm/gestures/system_pinch_handler.cc
index a0f5d12e00b04642df7a0f6a552d6e5dd80ac397..e90a21f47f85dba88b18abbeedb548b2e8d53ac0 100644
--- a/ash/wm/gestures/system_pinch_handler.cc
+++ b/ash/wm/gestures/system_pinch_handler.cc
@@ -86,14 +86,18 @@ SystemGestureStatus SystemPinchHandler::ProcessGestureEvent(
if (event.details().swipe_left() || event.details().swipe_right()) {
// Snap for left/right swipes.
- ui::ScopedLayerAnimationSettings settings(
- target_->layer()->GetAnimator());
- internal::SnapSizer::SnapWindow(target_,
- event.details().swipe_left() ? internal::SnapSizer::LEFT_EDGE :
- internal::SnapSizer::RIGHT_EDGE);
+ using internal::SnapSizer;
+ if (SnapSizer::CanSnapWindow(target_)) {
+ ui::ScopedLayerAnimationSettings settings(
+ target_->layer()->GetAnimator());
+ SnapSizer::Edge edge = event.details().swipe_left() ?
+ SnapSizer::LEFT_EDGE : SnapSizer::RIGHT_EDGE;
+ SnapSizer::SnapWindow(target_, edge, SnapSizer::STEP_NO);
+ }
} else if (event.details().swipe_up()) {
if (!wm::IsWindowMaximized(target_) &&
- !wm::IsWindowFullscreen(target_))
+ !wm::IsWindowFullscreen(target_) &&
+ wm::CanMaximizeWindow(target_))
wm::MaximizeWindow(target_);
} else if (event.details().swipe_down()) {
wm::MinimizeWindow(target_);

Powered by Google App Engine
This is Rietveld 408576698