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 CONTENT_BROWSER_RENDERER_HOST_INPUT_GESTURE_EVENT_QUEUE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_GESTURE_EVENT_QUEUE_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_GESTURE_EVENT_QUEUE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_GESTURE_EVENT_QUEUE_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // Controls touchpad-related tap suppression, disabled by default. | 66 // Controls touchpad-related tap suppression, disabled by default. |
67 TapSuppressionController::Config touchpad_tap_suppression_config; | 67 TapSuppressionController::Config touchpad_tap_suppression_config; |
68 | 68 |
69 // Controls touchscreen-related tap suppression, disabled by default. | 69 // Controls touchscreen-related tap suppression, disabled by default. |
70 TapSuppressionController::Config touchscreen_tap_suppression_config; | 70 TapSuppressionController::Config touchscreen_tap_suppression_config; |
71 | 71 |
72 // Determines whether non-scroll gesture events are "debounced" during an | 72 // Determines whether non-scroll gesture events are "debounced" during an |
73 // active scroll sequence, suppressing brief scroll interruptions. | 73 // active scroll sequence, suppressing brief scroll interruptions. |
74 // Zero by default (disabled). | 74 // Zero by default (disabled). |
75 base::TimeDelta debounce_interval; | 75 base::TimeDelta debounce_interval; |
| 76 |
| 77 // Whether to filter unnecessary GestureFlingCancel events. Filtering should |
| 78 // be disabled if there may be content-targetting fling curves about which |
| 79 // the renderer is unaware (e.g., with Android WebView). |
| 80 // True by default. |
| 81 bool enable_fling_cancel_filtering; |
76 }; | 82 }; |
77 | 83 |
78 // Both |client| and |touchpad_client| must outlive the GestureEventQueue. | 84 // Both |client| and |touchpad_client| must outlive the GestureEventQueue. |
79 GestureEventQueue(GestureEventQueueClient* client, | 85 GestureEventQueue(GestureEventQueueClient* client, |
80 TouchpadTapSuppressionControllerClient* touchpad_client, | 86 TouchpadTapSuppressionControllerClient* touchpad_client, |
81 const Config& config); | 87 const Config& config); |
82 ~GestureEventQueue(); | 88 ~GestureEventQueue(); |
83 | 89 |
84 // Adds a gesture to the queue if it passes the relevant filters. If | 90 // Adds a gesture to the queue if it passes the relevant filters. If |
85 // there are no events currently queued, the event will be forwarded | 91 // there are no events currently queued, the event will be forwarded |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 void QueueScrollOrPinchAndForwardIfNecessary( | 158 void QueueScrollOrPinchAndForwardIfNecessary( |
153 const GestureEventWithLatencyInfo& gesture_event); | 159 const GestureEventWithLatencyInfo& gesture_event); |
154 | 160 |
155 // The number of sent events for which we're awaiting an ack. These events | 161 // The number of sent events for which we're awaiting an ack. These events |
156 // remain at the head of the queue until ack'ed. | 162 // remain at the head of the queue until ack'ed. |
157 size_t EventsInFlightCount() const; | 163 size_t EventsInFlightCount() const; |
158 | 164 |
159 // The receiver of all forwarded gesture events. | 165 // The receiver of all forwarded gesture events. |
160 GestureEventQueueClient* client_; | 166 GestureEventQueueClient* client_; |
161 | 167 |
| 168 // Whether to filter unnecessary GestureFlingCancel events. |
| 169 bool enable_fling_cancel_filtering_; |
| 170 |
162 // Whether there are any active flings in the renderer. As the fling | 171 // Whether there are any active flings in the renderer. As the fling |
163 // end notification is asynchronous, we use a count rather than a boolean | 172 // end notification is asynchronous, we use a count rather than a boolean |
164 // to avoid races in bookkeeping when starting a new fling. | 173 // to avoid races in bookkeeping when starting a new fling. |
165 int active_fling_count_; | 174 int active_fling_count_; |
166 | 175 |
167 // True if a GestureScrollUpdate sequence is in progress. | 176 // True if a GestureScrollUpdate sequence is in progress. |
168 bool scrolling_in_progress_; | 177 bool scrolling_in_progress_; |
169 | 178 |
170 // True if two related gesture events were sent before without waiting | 179 // True if two related gesture events were sent before without waiting |
171 // for an ACK, so the next gesture ACK should be ignored. | 180 // for an ACK, so the next gesture ACK should be ignored. |
(...skipping 30 matching lines...) Expand all Loading... |
202 // Time window in which to debounce scroll/fling ends. Note that an interval | 211 // Time window in which to debounce scroll/fling ends. Note that an interval |
203 // of zero effectively disables debouncing. | 212 // of zero effectively disables debouncing. |
204 base::TimeDelta debounce_interval_; | 213 base::TimeDelta debounce_interval_; |
205 | 214 |
206 DISALLOW_COPY_AND_ASSIGN(GestureEventQueue); | 215 DISALLOW_COPY_AND_ASSIGN(GestureEventQueue); |
207 }; | 216 }; |
208 | 217 |
209 } // namespace content | 218 } // namespace content |
210 | 219 |
211 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_GESTURE_EVENT_QUEUE_H_ | 220 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_GESTURE_EVENT_QUEUE_H_ |
OLD | NEW |