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

Unified Diff: ash/wm/gestures/system_pinch_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/accelerators/accelerator_controller.cc ('k') | ash/wm/gestures/two_finger_drag_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f34836cf534453627c2f9cd701c0b5adf15a466d..b95adc819315000075c7a28921e3d6f80fb4dfab 100644
--- a/ash/wm/gestures/system_pinch_handler.cc
+++ b/ash/wm/gestures/system_pinch_handler.cc
@@ -83,21 +83,12 @@ SystemGestureStatus SystemPinchHandler::ProcessGestureEvent(
phantom_state_ = PHANTOM_WINDOW_NORMAL;
if (event.details().swipe_left() || event.details().swipe_right()) {
- // Snap for left/right swipes. In case the window is
- // maximized/fullscreen, then restore the window first so that tiling
- // works correctly.
- if (wm::IsWindowMaximized(target_) ||
- wm::IsWindowFullscreen(target_))
- wm::RestoreWindow(target_);
-
+ // Snap for left/right swipes.
ui::ScopedLayerAnimationSettings settings(
target_->layer()->GetAnimator());
- SnapSizer sizer(target_,
- gfx::Point(),
+ internal::SnapSizer::SnapWindow(target_,
event.details().swipe_left() ? internal::SnapSizer::LEFT_EDGE :
- internal::SnapSizer::RIGHT_EDGE,
- internal::SnapSizer::OTHER_INPUT);
- target_->SetBounds(sizer.GetSnapBounds(target_->bounds()));
+ internal::SnapSizer::RIGHT_EDGE);
} else if (event.details().swipe_up()) {
if (!wm::IsWindowMaximized(target_) &&
!wm::IsWindowFullscreen(target_))
« no previous file with comments | « ash/accelerators/accelerator_controller.cc ('k') | ash/wm/gestures/two_finger_drag_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698