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" |
(...skipping 27 matching lines...) Expand all Loading... |
38 // enabled, there will always be a delay before a tap event is fired, in | 38 // 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 | 39 // order to allow the double tap gesture to occur without firing any tap |
40 // events. | 40 // events. |
41 bool disable_click_delay; | 41 bool disable_click_delay; |
42 | 42 |
43 // If |gesture_begin_end_types_enabled| is true, fire an ET_GESTURE_BEGIN | 43 // 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 | 44 // event for every added touch point, and an ET_GESTURE_END event for every |
45 // removed touch point. Defaults to false. | 45 // removed touch point. Defaults to false. |
46 bool gesture_begin_end_types_enabled; | 46 bool gesture_begin_end_types_enabled; |
47 | 47 |
48 // The minimum size (both length and width, in dips) of the generated | 48 // The min and max size (both length and width, in dips) of the generated |
49 // bounding box for all gesture types. This is useful for touch streams | 49 // bounding box for all gesture types. This is useful for touch streams |
50 // that may report zero or unreasonably small touch sizes. | 50 // that may report zero or unreasonably small or large touch sizes. |
51 // Defaults to 0. | 51 // Both values default to 0 (disabled). |
52 float min_gesture_bounds_length; | 52 float min_gesture_bounds_length; |
| 53 float max_gesture_bounds_length; |
53 }; | 54 }; |
54 | 55 |
55 GestureProvider(const Config& config, GestureProviderClient* client); | 56 GestureProvider(const Config& config, GestureProviderClient* client); |
56 ~GestureProvider(); | 57 ~GestureProvider(); |
57 | 58 |
58 // Handle the incoming MotionEvent, returning false if the event could not | 59 // Handle the incoming MotionEvent, returning false if the event could not |
59 // be handled. | 60 // be handled. |
60 bool OnTouchEvent(const MotionEvent& event); | 61 bool OnTouchEvent(const MotionEvent& event); |
61 | 62 |
62 // Update whether multi-touch pinch zoom is supported by the platform. | 63 // Update whether multi-touch pinch zoom is supported by the platform. |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 bool double_tap_support_for_platform_; | 123 bool double_tap_support_for_platform_; |
123 | 124 |
124 // Keeps track of the current GESTURE_LONG_PRESS event. If a context menu is | 125 // Keeps track of the current GESTURE_LONG_PRESS event. If a context menu is |
125 // opened after a GESTURE_LONG_PRESS, this is used to insert a | 126 // opened after a GESTURE_LONG_PRESS, this is used to insert a |
126 // GESTURE_TAP_CANCEL for removing any ::active styling. | 127 // GESTURE_TAP_CANCEL for removing any ::active styling. |
127 base::TimeTicks current_longpress_time_; | 128 base::TimeTicks current_longpress_time_; |
128 | 129 |
129 const bool gesture_begin_end_types_enabled_; | 130 const bool gesture_begin_end_types_enabled_; |
130 | 131 |
131 const float min_gesture_bounds_length_; | 132 const float min_gesture_bounds_length_; |
| 133 const float max_gesture_bounds_length_; |
132 }; | 134 }; |
133 | 135 |
134 } // namespace ui | 136 } // namespace ui |
135 | 137 |
136 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_PROVIDER_H_ | 138 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_PROVIDER_H_ |
OLD | NEW |