| 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..9d1089749a88e7b37842c240d1a1991e8a5d833d 100644
|
| --- a/content/browser/renderer_host/input/touch_event_queue.h
|
| +++ b/content/browser/renderer_host/input/touch_event_queue.h
|
| @@ -35,9 +35,27 @@ class CONTENT_EXPORT TouchEventQueueClient {
|
| // A queue for throttling and coalescing touch-events.
|
| class CONTENT_EXPORT TouchEventQueue {
|
| public:
|
| + // 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
|
| + };
|
|
|
| // The |client| must outlive the TouchEventQueue.
|
| - explicit TouchEventQueue(TouchEventQueueClient* client);
|
| + explicit TouchEventQueue(TouchEventQueueClient* client,
|
| + TouchScrollingMode mode = TOUCH_SCROLLING_MODE_TOUCHCANCEL);
|
| ~TouchEventQueue();
|
|
|
| // Adds an event to the queue. The event may be coalesced with previously
|
| @@ -58,6 +76,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,7 +135,6 @@ class CONTENT_EXPORT TouchEventQueue {
|
| void UpdateTouchAckStates(const blink::WebTouchEvent& event,
|
| InputEventAckState ack_result);
|
|
|
| -
|
| // Handles touch event forwarding and ack'ed event dispatch.
|
| TouchEventQueueClient* client_;
|
|
|
| @@ -147,6 +168,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);
|
| };
|
|
|
|
|