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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 blink::WebInputEvent::Type type, | 79 blink::WebInputEvent::Type type, |
80 const ui::LatencyInfo& latency); | 80 const ui::LatencyInfo& latency); |
81 | 81 |
82 // Sets the state of the |fling_in_progress_| field to indicate that a fling | 82 // Sets the state of the |fling_in_progress_| field to indicate that a fling |
83 // is definitely not in progress. | 83 // is definitely not in progress. |
84 void FlingHasBeenHalted(); | 84 void FlingHasBeenHalted(); |
85 | 85 |
86 // Returns the |TouchpadTapSuppressionController| instance. | 86 // Returns the |TouchpadTapSuppressionController| instance. |
87 TouchpadTapSuppressionController* GetTouchpadTapSuppressionController(); | 87 TouchpadTapSuppressionController* GetTouchpadTapSuppressionController(); |
88 | 88 |
89 // Returns whether there are any gesture event in the queue. | 89 void ForwardGestureEvent(const GestureEventWithLatencyInfo& gesture_event); |
90 bool HasQueuedGestureEvents() const; | |
91 | 90 |
92 void ForwardGestureEvent(const GestureEventWithLatencyInfo& gesture_event); | 91 // Whether the queue is expecting a gesture event ack. |
| 92 bool ExpectingGestureAck() const; |
| 93 |
| 94 bool empty() const { |
| 95 return coalesced_gesture_events_.empty() && |
| 96 debouncing_deferral_queue_.empty(); |
| 97 } |
93 | 98 |
94 void set_debounce_enabled_for_testing(bool enabled) { | 99 void set_debounce_enabled_for_testing(bool enabled) { |
95 debounce_enabled_ = enabled; | 100 debounce_enabled_ = enabled; |
96 } | 101 } |
97 | 102 |
98 void set_debounce_interval_time_ms_for_testing(int interval_time_ms) { | 103 void set_debounce_interval_time_ms_for_testing(int interval_time_ms) { |
99 debounce_interval_time_ms_ = interval_time_ms; | 104 debounce_interval_time_ms_ = interval_time_ms; |
100 } | 105 } |
101 | 106 |
102 private: | 107 private: |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 // Whether scroll-ending events should be deferred when a scroll is active. | 224 // Whether scroll-ending events should be deferred when a scroll is active. |
220 // Defaults to true. | 225 // Defaults to true. |
221 bool debounce_enabled_; | 226 bool debounce_enabled_; |
222 | 227 |
223 DISALLOW_COPY_AND_ASSIGN(GestureEventQueue); | 228 DISALLOW_COPY_AND_ASSIGN(GestureEventQueue); |
224 }; | 229 }; |
225 | 230 |
226 } // namespace content | 231 } // namespace content |
227 | 232 |
228 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_GESTURE_EVENT_QUEUE_H_ | 233 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_GESTURE_EVENT_QUEUE_H_ |
OLD | NEW |