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

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..6a27146cc7fc885cdb0ab94d70c455e38919d25c 100644
--- a/ash/wm/gestures/system_pinch_handler.cc
+++ b/ash/wm/gestures/system_pinch_handler.cc
@@ -11,7 +11,6 @@
#include "ash/wm/property_util.h"
#include "ash/wm/window_animations.h"
#include "ash/wm/window_util.h"
-#include "ash/wm/workspace/snap_sizer.h"
#include "ui/aura/window.h"
#include "ui/base/events/event_constants.h"
#include "ui/base/gestures/gesture_types.h"
@@ -86,15 +85,19 @@ 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);
+ if (wm::CanSnapWindow(target_)) {
+ ui::ScopedLayerAnimationSettings settings(
+ target_->layer()->GetAnimator());
+ wm::SnapWindowToEdge(target_,
+ event.details().swipe_left() ? wm::SNAP_LEFT_EDGE :
+ wm::SNAP_RIGHT_EDGE);
+ }
} 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_);
} else {

Powered by Google App Engine
This is Rietveld 408576698