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 229904ea8d705d904cd3ca93947610ef25fa694f..b7b7d1c00871a179cc6f46329c58f2f143e6dfe8 100644 |
--- a/content/browser/renderer_host/gesture_event_filter.h |
+++ b/content/browser/renderer_host/gesture_event_filter.h |
@@ -15,7 +15,8 @@ |
namespace content { |
class MockRenderWidgetHost; |
class RenderWidgetHostImpl; |
-class TapSuppressionController; |
+class TouchpadTapSuppressionController; |
+class TouchscreenTapSuppressionController; |
// Applies a sequence of filters to WebGestureEvents instances. |
// First: the sequence is filtered for bounces. A bounce is when the finger |
@@ -49,8 +50,8 @@ class GestureEventFilter { |
// definitely not in progress. |
void FlingHasBeenHalted(); |
- // Return the |TapSuppressionController| instance. |
- TapSuppressionController* GetTapSuppressionController(); |
+ // Return the |TouchpadTapSuppressionController| instance. |
+ TouchpadTapSuppressionController* GetTouchpadTapSuppressionController(); |
// Returns whether there are any gesture event in the queue. |
bool HasQueuedGestureEvents() const; |
@@ -58,6 +59,14 @@ class GestureEventFilter { |
// Returns the last gesture event that was sent to the renderer. |
const WebKit::WebInputEvent& GetGestureEventAwaitingAck() const; |
mohsen
2013/02/04 15:09:05
Following two public methods are added to be calle
|
+ // Tries forwarding the event to the tap deferral sub-filter. |
+ void ForwardGestureEventForDeferral( |
+ const WebKit::WebGestureEvent& gesture_event); |
+ |
+ // Tries forwarding the event, skipping the tap deferral sub-filter. |
+ void ForwardGestureEventSkipDeferral( |
+ const WebKit::WebGestureEvent& gesture_event); |
+ |
private: |
friend class MockRenderWidgetHost; |
@@ -86,11 +95,23 @@ class GestureEventFilter { |
bool ShouldForwardForBounceReduction( |
const WebKit::WebGestureEvent& gesture_event); |
+ // Sub-filter for removing extra GestureFlingCancels. |
+ bool ShouldForwardForGFCFiltering( |
+ const WebKit::WebGestureEvent& gesture_event); |
+ |
+ // Sub-filter for suppressing taps immediately after a GestureFlingCancel. |
+ bool ShouldForwardForTapSuppression( |
+ const WebKit::WebGestureEvent& gesture_event); |
+ |
// Sub-filter for removing unnecessary GestureFlingCancels and deferring |
// GestureTapDowns. |
bool ShouldForwardForTapDeferral( |
const WebKit::WebGestureEvent& gesture_event); |
+ // Enqueus the event in the coalesced events queue and if it is in front of |
rjkroege
2013/02/05 16:00:07
nit sp Enqueues
mohsen
2013/02/06 16:13:06
Done.
|
+ // the queue, forwards it immediately. |
+ void TryForwardGestureEvent(const WebKit::WebGestureEvent& gesture_event); |
+ |
// Only a RenderWidgetHostViewImpl can own an instance. |
RenderWidgetHostImpl* render_widget_host_; |
@@ -107,7 +128,18 @@ class GestureEventFilter { |
// An object tracking the state of touchpad action on the delivery of mouse |
// events to the renderer to filter mouse immediately after a touchpad |
// fling canceling tap. |
- scoped_ptr<TapSuppressionController> tap_suppression_controller_; |
+ scoped_ptr<TouchpadTapSuppressionController> |
+ touchpad_tap_suppression_controller_; |
mohsen
2013/02/04 15:09:05
Should this line be broken like this?
rjkroege
2013/02/05 16:00:07
general algorithm is if len(line) > 80, split at s
|
+ |
+ // An object tracking the state of touchscreen action on the delivery of |
rjkroege
2013/02/05 16:00:07
of a touchscreen
mohsen
2013/02/06 16:13:06
Sentence changed a bit.
|
+ // gesture tap events to the renderer to filter taps immediately after a |
+ // touchscreen fling canceling tap. |
+ scoped_ptr<TouchscreenTapSuppressionController> |
+ touchscreen_tap_suppression_controller_; |
+ |
+ // Whenever a GestureFlingCancel is forwarded, its source device is saved, so |
rjkroege
2013/02/05 16:00:07
Do we still queue the events until acked? If so, w
mohsen
2013/02/06 16:13:06
Yes, you are right. The event is in front of queue
|
+ // that when an Ack for a GFC is received, we know its source device. |
+ WebKit::WebGestureEvent::SourceDevice last_gfc_source_device_; |
typedef std::deque<WebKit::WebGestureEvent> GestureEventQueue; |