Index: content/browser/renderer_host/input/touch_event_queue.h |
diff --git a/content/browser/renderer_host/input/touch_event_queue.h b/content/browser/renderer_host/input/touch_event_queue.h |
index aa2eb11d04be069139595b62794ac6cdaf24c8ba..a317a4630fbd49cfdbbf9e75de040d982cfe3856 100644 |
--- a/content/browser/renderer_host/input/touch_event_queue.h |
+++ b/content/browser/renderer_host/input/touch_event_queue.h |
@@ -58,6 +58,10 @@ class CONTENT_EXPORT TouchEventQueue { |
// resume the normal flow of sending touch events to the renderer. |
void OnGestureScrollEvent(const GestureEventWithLatencyInfo& gesture_event); |
+ void OnGestureEventAck( |
+ const GestureEventWithLatencyInfo& event, |
+ InputEventAckState ack_result); |
+ |
// Notifies the queue whether the renderer has at least one touch handler. |
void OnHasTouchEventHandlers(bool has_handlers); |
@@ -113,6 +117,24 @@ class CONTENT_EXPORT TouchEventQueue { |
void UpdateTouchAckStates(const blink::WebTouchEvent& event, |
InputEventAckState ack_result); |
+ // Different ways of dealing with touch events during scrolling. |
+ // TODO(rbyers): Remove (or otherwise update) this once results of |
+ // experiments are complete. http://crbug.com/328503 |
+ enum TouchScrollingMode { |
+ // Send a touchcancel on scroll start and no further touch events for the |
+ // duration of the scroll. Chrome Android's traditional behavior. |
+ TOUCH_SCROLLING_MODE_TOUCHCANCEL, |
+ // Send touchmove events throughout a scroll, blocking on each ACK and |
+ // using the disposition to determine whether a scroll update should be |
+ // sent. Mobile Safari's default overflow scroll behavior. |
+ TOUCH_SCROLLING_MODE_SYNC_TOUCHMOVE, |
+ // Like sync, except that consumed scroll events cause subsequent touchmove |
+ // events to be suppressed. Unconsumed scroll events return touchmove |
+ // events to being dispatched synchronously (so scrolling may be hijacked |
+ // when a scroll limit is reached, and later resumed). |
+ TOUCH_SCROLLING_MODE_ABSORB_TOUCHMOVE |
+ }; |
+ static TouchScrollingMode GetTouchScrollingMode(); |
// Handles touch event forwarding and ack'ed event dispatch. |
TouchEventQueueClient* client_; |
@@ -147,6 +169,18 @@ class CONTENT_EXPORT TouchEventQueue { |
bool ack_timeout_enabled_; |
scoped_ptr<TouchTimeoutHandler> timeout_handler_; |
+ // How touch events are handled during scrolling. For now this is a global |
+ // setting for experimentation, but we may evolve it into an app-controlled |
+ // mode. |
+ const TouchScrollingMode touch_scrolling_mode_; |
+ |
+ // Wether touchmove events should be dropped due to the |
+ // TOUCH_SCROLLING_MODE_ABSORB_TOUCHMOVE mode. Note that we can't use |
+ // touch_filtering_state_ for this (without adding a few new states and |
+ // complicating the code significantly) because it can occur with and without |
+ // timeout, and shouldn't cause touchend to be dropped. |
+ bool absorbing_touch_moves_; |
+ |
DISALLOW_COPY_AND_ASSIGN(TouchEventQueue); |
}; |