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

Side by Side Diff: ash/wm/toplevel_window_event_handler.cc

Issue 302463004: Implementing the dispatch of the swipe gesture for one-finger touch swipes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing review feedback and also rebasing to resolve conflicts. Created 6 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/toplevel_window_event_handler.h" 5 #include "ash/wm/toplevel_window_event_handler.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/wm/resize_shadow_controller.h" 8 #include "ash/wm/resize_shadow_controller.h"
9 #include "ash/wm/window_resizer.h" 9 #include "ash/wm/window_resizer.h"
10 #include "ash/wm/window_state.h" 10 #include "ash/wm/window_state.h"
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 kMinHorizVelocityForWindowSwipe) { 337 kMinHorizVelocityForWindowSwipe) {
338 SetWindowStateTypeFromGesture(target, 338 SetWindowStateTypeFromGesture(target,
339 wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED); 339 wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED);
340 } else if (event->details().velocity_x() < 340 } else if (event->details().velocity_x() <
341 -kMinHorizVelocityForWindowSwipe) { 341 -kMinHorizVelocityForWindowSwipe) {
342 SetWindowStateTypeFromGesture(target, 342 SetWindowStateTypeFromGesture(target,
343 wm::WINDOW_STATE_TYPE_LEFT_SNAPPED); 343 wm::WINDOW_STATE_TYPE_LEFT_SNAPPED);
344 } 344 }
345 event->StopPropagation(); 345 event->StopPropagation();
346 return; 346 return;
347 case ui::ET_GESTURE_MULTIFINGER_SWIPE: 347 case ui::ET_GESTURE_SWIPE:
348 DCHECK(event->details().touch_points() > 0);
sky 2014/05/27 17:27:54 DCHECK_GT
mfomitchev 2014/05/27 18:33:43 Done.
349 if (event->details().touch_points() == 1)
350 return;
348 if (!wm::GetWindowState(target)->IsNormalOrSnapped()) 351 if (!wm::GetWindowState(target)->IsNormalOrSnapped())
349 return; 352 return;
350 353
351 CompleteDrag(DRAG_COMPLETE); 354 CompleteDrag(DRAG_COMPLETE);
352 355
353 if (event->details().swipe_down()) { 356 if (event->details().swipe_down()) {
354 SetWindowStateTypeFromGesture(target, wm::WINDOW_STATE_TYPE_MINIMIZED); 357 SetWindowStateTypeFromGesture(target, wm::WINDOW_STATE_TYPE_MINIMIZED);
355 } else if (event->details().swipe_up()) { 358 } else if (event->details().swipe_up()) {
356 SetWindowStateTypeFromGesture(target, wm::WINDOW_STATE_TYPE_MAXIMIZED); 359 SetWindowStateTypeFromGesture(target, wm::WINDOW_STATE_TYPE_MAXIMIZED);
357 } else if (event->details().swipe_right()) { 360 } else if (event->details().swipe_right()) {
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 609
607 void ToplevelWindowEventHandler::ResizerWindowDestroyed() { 610 void ToplevelWindowEventHandler::ResizerWindowDestroyed() {
608 // We explicitly don't invoke RevertDrag() since that may do things to window. 611 // We explicitly don't invoke RevertDrag() since that may do things to window.
609 // Instead we destroy the resizer. 612 // Instead we destroy the resizer.
610 window_resizer_.reset(); 613 window_resizer_.reset();
611 614
612 CompleteDrag(DRAG_REVERT); 615 CompleteDrag(DRAG_REVERT);
613 } 616 }
614 617
615 } // namespace ash 618 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698