OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 UI_EVENTS_GESTURE_DETECTION_GESTURE_PROVIDER_H_ | 5 #ifndef UI_EVENTS_GESTURE_DETECTION_GESTURE_PROVIDER_H_ |
6 #define UI_EVENTS_GESTURE_DETECTION_GESTURE_PROVIDER_H_ | 6 #define UI_EVENTS_GESTURE_DETECTION_GESTURE_PROVIDER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "ui/events/gesture_detection/gesture_detection_export.h" | 10 #include "ui/events/gesture_detection/gesture_detection_export.h" |
11 #include "ui/events/gesture_detection/gesture_detector.h" | 11 #include "ui/events/gesture_detection/gesture_detector.h" |
12 #include "ui/events/gesture_detection/scale_gesture_detector.h" | 12 #include "ui/events/gesture_detection/scale_gesture_detector.h" |
13 #include "ui/events/gesture_detection/snap_scroll_controller.h" | 13 #include "ui/events/gesture_detection/snap_scroll_controller.h" |
| 14 #include "ui/gfx/display.h" |
14 | 15 |
15 namespace ui { | 16 namespace ui { |
16 | 17 |
17 struct GestureEventData; | 18 struct GestureEventData; |
18 | 19 |
19 class GESTURE_DETECTION_EXPORT GestureProviderClient { | 20 class GESTURE_DETECTION_EXPORT GestureProviderClient { |
20 public: | 21 public: |
21 virtual ~GestureProviderClient() {} | 22 virtual ~GestureProviderClient() {} |
22 virtual void OnGestureEvent(const GestureEventData& gesture) = 0; | 23 virtual void OnGestureEvent(const GestureEventData& gesture) = 0; |
23 }; | 24 }; |
24 | 25 |
25 // Given a stream of |MotionEvent|'s, provides gesture detection and gesture | 26 // Given a stream of |MotionEvent|'s, provides gesture detection and gesture |
26 // event dispatch. | 27 // event dispatch. |
27 class GESTURE_DETECTION_EXPORT GestureProvider { | 28 class GESTURE_DETECTION_EXPORT GestureProvider { |
28 public: | 29 public: |
29 struct GESTURE_DETECTION_EXPORT Config { | 30 struct GESTURE_DETECTION_EXPORT Config { |
30 Config(); | 31 Config(); |
31 ~Config(); | 32 ~Config(); |
| 33 gfx::Display display; |
32 GestureDetector::Config gesture_detector_config; | 34 GestureDetector::Config gesture_detector_config; |
33 ScaleGestureDetector::Config scale_gesture_detector_config; | 35 ScaleGestureDetector::Config scale_gesture_detector_config; |
34 SnapScrollController::Config snap_scroll_controller_config; | |
35 | 36 |
36 // If |disable_click_delay| is true and double-tap support is disabled, | 37 // If |disable_click_delay| is true and double-tap support is disabled, |
37 // there will be no delay before tap events. When double-tap support is | 38 // there will be no delay before tap events. When double-tap support is |
38 // enabled, there will always be a delay before a tap event is fired, in | 39 // enabled, there will always be a delay before a tap event is fired, in |
39 // order to allow the double tap gesture to occur without firing any tap | 40 // order to allow the double tap gesture to occur without firing any tap |
40 // events. | 41 // events. |
41 bool disable_click_delay; | 42 bool disable_click_delay; |
42 | 43 |
43 // If |gesture_begin_end_types_enabled| is true, fire an ET_GESTURE_BEGIN | 44 // If |gesture_begin_end_types_enabled| is true, fire an ET_GESTURE_BEGIN |
44 // event for every added touch point, and an ET_GESTURE_END event for every | 45 // event for every added touch point, and an ET_GESTURE_END event for every |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // opened after a GESTURE_LONG_PRESS, this is used to insert a | 144 // opened after a GESTURE_LONG_PRESS, this is used to insert a |
144 // GESTURE_TAP_CANCEL for removing any ::active styling. | 145 // GESTURE_TAP_CANCEL for removing any ::active styling. |
145 base::TimeTicks current_longpress_time_; | 146 base::TimeTicks current_longpress_time_; |
146 | 147 |
147 bool gesture_begin_end_types_enabled_; | 148 bool gesture_begin_end_types_enabled_; |
148 }; | 149 }; |
149 | 150 |
150 } // namespace ui | 151 } // namespace ui |
151 | 152 |
152 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_PROVIDER_H_ | 153 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_PROVIDER_H_ |
OLD | NEW |