Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2709)

Unified Diff: content/browser/renderer_host/gesture_event_filter.h

Issue 10855200: Defer GestureTapDown events briefly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: proof-reading corrections Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/renderer_host/gesture_event_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « no previous file | content/browser/renderer_host/gesture_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698