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 <memory> | 8 #include <memory> |
9 | 9 |
| 10 #include "ui/display/display.h" |
10 #include "ui/events/gesture_detection/gesture_detection_export.h" | 11 #include "ui/events/gesture_detection/gesture_detection_export.h" |
11 #include "ui/events/gesture_detection/gesture_detector.h" | 12 #include "ui/events/gesture_detection/gesture_detector.h" |
12 #include "ui/events/gesture_detection/gesture_event_data.h" | 13 #include "ui/events/gesture_detection/gesture_event_data.h" |
13 #include "ui/events/gesture_detection/gesture_touch_uma_histogram.h" | 14 #include "ui/events/gesture_detection/gesture_touch_uma_histogram.h" |
14 #include "ui/events/gesture_detection/scale_gesture_detector.h" | 15 #include "ui/events/gesture_detection/scale_gesture_detector.h" |
15 #include "ui/events/gesture_detection/snap_scroll_controller.h" | 16 #include "ui/events/gesture_detection/snap_scroll_controller.h" |
16 #include "ui/gfx/display.h" | |
17 | 17 |
18 namespace ui { | 18 namespace ui { |
19 | 19 |
20 class GESTURE_DETECTION_EXPORT GestureProviderClient { | 20 class GESTURE_DETECTION_EXPORT GestureProviderClient { |
21 public: | 21 public: |
22 virtual ~GestureProviderClient() {} | 22 virtual ~GestureProviderClient() {} |
23 virtual void OnGestureEvent(const GestureEventData& gesture) = 0; | 23 virtual void OnGestureEvent(const GestureEventData& gesture) = 0; |
24 }; | 24 }; |
25 | 25 |
26 // Given a stream of |MotionEvent|'s, provides gesture detection and gesture | 26 // Given a stream of |MotionEvent|'s, provides gesture detection and gesture |
27 // event dispatch. | 27 // event dispatch. |
28 class GESTURE_DETECTION_EXPORT GestureProvider { | 28 class GESTURE_DETECTION_EXPORT GestureProvider { |
29 public: | 29 public: |
30 struct GESTURE_DETECTION_EXPORT Config { | 30 struct GESTURE_DETECTION_EXPORT Config { |
31 Config(); | 31 Config(); |
32 Config(const Config& other); | 32 Config(const Config& other); |
33 ~Config(); | 33 ~Config(); |
34 gfx::Display display; | 34 display::Display display; |
35 GestureDetector::Config gesture_detector_config; | 35 GestureDetector::Config gesture_detector_config; |
36 ScaleGestureDetector::Config scale_gesture_detector_config; | 36 ScaleGestureDetector::Config scale_gesture_detector_config; |
37 | 37 |
38 // Whether double-tap detection is supported by the platform. If disabled, | 38 // Whether double-tap detection is supported by the platform. If disabled, |
39 // there will be no delay before tap events. Defaults to true. | 39 // there will be no delay before tap events. Defaults to true. |
40 bool double_tap_support_for_platform_enabled; | 40 bool double_tap_support_for_platform_enabled; |
41 | 41 |
42 // If |gesture_begin_end_types_enabled| is true, fire an ET_GESTURE_BEGIN | 42 // If |gesture_begin_end_types_enabled| is true, fire an ET_GESTURE_BEGIN |
43 // event for every added touch point, and an ET_GESTURE_END event for every | 43 // event for every added touch point, and an ET_GESTURE_END event for every |
44 // removed touch point. This requires one ACTION_CANCEL event to be sent per | 44 // removed touch point. This requires one ACTION_CANCEL event to be sent per |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // Whether double-tap gesture detection is currently supported. | 111 // Whether double-tap gesture detection is currently supported. |
112 bool double_tap_support_for_page_; | 112 bool double_tap_support_for_page_; |
113 bool double_tap_support_for_platform_; | 113 bool double_tap_support_for_platform_; |
114 | 114 |
115 const bool gesture_begin_end_types_enabled_; | 115 const bool gesture_begin_end_types_enabled_; |
116 }; | 116 }; |
117 | 117 |
118 } // namespace ui | 118 } // namespace ui |
119 | 119 |
120 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_PROVIDER_H_ | 120 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_PROVIDER_H_ |
OLD | NEW |