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

Unified Diff: content/browser/renderer_host/input/touch_event_queue.h

Issue 130993003: Prevent partial touch sequences from reaching the renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 11 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
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 aa211af8a649e6dfd5f233b55d17e203c99618d4..a79a33a56108866b9d82a9763cc56c2e0faeb634 100644
--- a/content/browser/renderer_host/input/touch_event_queue.h
+++ b/content/browser/renderer_host/input/touch_event_queue.h
@@ -82,7 +82,7 @@ class CONTENT_EXPORT TouchEventQueue {
}
bool has_handlers() const {
- return has_handlers_;
+ return touch_handling_state_ != NO_TOUCH_HANDLER;
}
private:
@@ -133,15 +133,15 @@ class CONTENT_EXPORT TouchEventQueue {
// ack after forwarding a touch event to the client.
bool dispatching_touch_;
- // Whether there are any registered touch handlers. Defaults to false.
- bool has_handlers_;
-
- // Don't send touch events to the renderer while scrolling.
- bool scroll_in_progress_;
-
- // Whether an event in the current (multi)touch sequence was consumed by the
- // renderer. The touch timeout will never be activated when this is true.
- bool renderer_is_consuming_touch_gesture_;
+ // Determines touch event forwarding decisions.
Rick Byers 2014/01/21 22:00:25 I like collapsing the bits into a single enum! I
jdduke (slow) 2014/01/22 02:47:00 That sounds just fine :) And I agree, using the te
+ enum TouchHandlingState {
+ HAS_TOUCH_HANDLER, // All events forwarded.
+ NO_TOUCH_HANDLER, // No events forwarded.
+ NO_TOUCH_HANDLER_FOR_GESTURE, // No more events in the sequence forwarded.
+ RENDERER_CONSUMING_GESTURE, // All events in the sequence forwarded.
+ TOUCH_HANDLING_STATE_DEFAULT = NO_TOUCH_HANDLER,
+ };
+ TouchHandlingState touch_handling_state_;
// Optional handler for timed-out touch event acks, disabled by default.
bool ack_timeout_enabled_;

Powered by Google App Engine
This is Rietveld 408576698