Index: content/browser/renderer_host/gesture_event_filter.h |
diff --git a/content/browser/renderer_host/gesture_event_filter.h b/content/browser/renderer_host/gesture_event_filter.h |
index aff3b318e35ebde4b9d0f5e3cb36b530e6634750..fc65630ec395399554a5b8cd0c7acdab28951e70 100644 |
--- a/content/browser/renderer_host/gesture_event_filter.h |
+++ b/content/browser/renderer_host/gesture_event_filter.h |
@@ -9,6 +9,8 @@ |
#include "base/basictypes.h" |
#include "base/memory/scoped_ptr.h" |
+#include "base/time.h" |
+#include "base/timer.h" |
#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
class MockRenderWidgetHost; |
@@ -48,32 +50,50 @@ class GestureEventFilter { |
private: |
friend class ::MockRenderWidgetHost; |
+ // Invoked on the expiration of the timer to release a deferred |
+ // GestureTapDown to the renderer. |
+ void SendGestureTapDownNow(); |
+ |
// Returns |true| if the given GestureFlingCancel should be discarded |
// as unnecessary. |
bool ShouldDiscardFlingCancelEvent( |
const WebKit::WebGestureEvent& gesture_event); |
+ // Return true if the only event in the queue is the current event and |
+ // hence that event should be handled now. |
+ bool ShouldHandleEventNow(); |
+ |
+ // Merge a GestureScrollUpdate into the queue if possible or append |
+ // it to the queue. |
+ void MergeOrInsertScrollEvent( |
+ const WebKit::WebGestureEvent& gesture_event); |
+ |
// Only a RenderWidgetHostViewImpl can own an instance. |
RenderWidgetHostImpl* render_widget_host_; |
- // True if a GestureFlingStart is in progress on the renderer. |
+ // True if a GestureFlingStart is in progress on the renderer or |
+ // queued without a subsequent queued GestureFlingCancel event. |
bool fling_in_progress_; |
- // (Similar to |mouse_wheel_pending_|.). True if gesture event was sent and |
- // we are waiting for a corresponding ack. |
- bool gesture_event_pending_; |
+ // Timer to release a previously deferred GestureTapDown event. |
+ base::OneShotTimer<GestureEventFilter> send_gtd_timer_; |
// An object tracking the state of touchpad action on the delivery of mouse |
- // events to the renderer to filter mouse actiosn immediately after a touchpad |
+ // events to the renderer to filter mouse immediately after a touchpad |
// fling canceling tap. |
scoped_ptr<TapSuppressionController> tap_suppression_controller_; |
typedef std::deque<WebKit::WebGestureEvent> GestureEventQueue; |
- // (Similar to |coalesced_mouse_wheel_events_|.) GestureScrollUpdate events |
- // are coalesced by merging deltas in a similar fashion as wheel events. |
+ // Queue of coalesced gesture events not yet sent to the renderer. |
GestureEventQueue coalesced_gesture_events_; |
+ // Tap gesture event currently subject to deferral. |
+ WebKit::WebGestureEvent deferred_tap_down_event_; |
+ |
+ // Time window in which to defer a GestureTapDown. |
+ int maximum_tap_gap_time_ms_; |
+ |
DISALLOW_COPY_AND_ASSIGN(GestureEventFilter); |
}; |