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

Side by Side Diff: ash/wm/gestures/overview_gesture_handler.h

Issue 2667293002: [ash-md] Adds support for gesture to move selection in overview mode (Closed)
Patch Set: [ash-md] Adds support for gesture to move selection in overview mode (tuning) Created 3 years, 10 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef ASH_WM_GESTURES_OVERVIEW_GESTURE_HANDLER_H_ 5 #ifndef ASH_WM_GESTURES_OVERVIEW_GESTURE_HANDLER_H_
6 #define ASH_WM_GESTURES_OVERVIEW_GESTURE_HANDLER_H_ 6 #define ASH_WM_GESTURES_OVERVIEW_GESTURE_HANDLER_H_
7 7
8 #include "ash/ash_export.h"
8 #include "base/macros.h" 9 #include "base/macros.h"
9 10
10 namespace ui { 11 namespace ui {
11 class ScrollEvent; 12 class ScrollEvent;
12 } 13 }
13 14
14 namespace ash { 15 namespace ash {
15 16
16 // This handles 3-finger touchpad scroll events to enter/exit overview mode. 17 // This handles 3-finger touchpad scroll events to enter/exit overview mode.
17 class OverviewGestureHandler { 18 class ASH_EXPORT OverviewGestureHandler {
18 public: 19 public:
19 OverviewGestureHandler(); 20 OverviewGestureHandler();
20 virtual ~OverviewGestureHandler(); 21 virtual ~OverviewGestureHandler();
21 22
22 // Processes a scroll event and may start overview. Returns true if the event 23 // Processes a scroll event and may start overview. Returns true if the event
23 // has been handled and should not be processed further, false otherwise. 24 // has been handled and should not be processed further, false otherwise.
24 bool ProcessScrollEvent(const ui::ScrollEvent& event); 25 bool ProcessScrollEvent(const ui::ScrollEvent& event);
25 26
26 private: 27 private:
27 // The total distance scrolled with three fingers. 28 friend class OverviewGestureHandlerTest;
29
30 // The total distance scrolled with 2 or three fingers up to the point when
tdanderson 2017/02/10 16:05:19 nit: update to just "three fingers"
varkha 2017/02/10 17:34:31 Done.
31 // an action is triggered. When the action (enter / exit overview mode or move
32 // selection in overview) is triggered those values are reset to zero.
28 float scroll_x_; 33 float scroll_x_;
29 float scroll_y_; 34 float scroll_y_;
30 35
36 // The threshold before engaging overview with a touchpad three-finger scroll.
37 static const float vertical_threshold_pixels_;
38
39 // The threshold before moving selector horizontally when using a touchpad
40 // two or three-finger scroll.
41 static const float horizontal_threshold_pixels_;
42
31 DISALLOW_COPY_AND_ASSIGN(OverviewGestureHandler); 43 DISALLOW_COPY_AND_ASSIGN(OverviewGestureHandler);
32 }; 44 };
33 45
34 } // namespace ash 46 } // namespace ash
35 47
36 #endif // ASH_WM_GESTURES_OVERVIEW_GESTURE_HANDLER_H_ 48 #endif // ASH_WM_GESTURES_OVERVIEW_GESTURE_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698