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

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: Comment 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..aa2eb11d04be069139595b62794ac6cdaf24c8ba 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_filtering_state_ != DROP_ALL_TOUCHES;
}
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_;
+ enum TouchFilteringState {
+ FORWARD_ALL_TOUCHES, // Don't filter at all - the default.
+ FORWARD_TOUCHES_UNTIL_TIMEOUT, // Don't filter unless we get an ACK timeout.
+ DROP_TOUCHES_IN_SEQUENCE, // Filter all events until a new touch
+ // sequence is received.
+ DROP_ALL_TOUCHES, // Filter all events, e.g., no touch handler.
+ TOUCH_FILTERING_STATE_DEFAULT = FORWARD_ALL_TOUCHES,
+ };
+ TouchFilteringState touch_filtering_state_;
// Optional handler for timed-out touch event acks, disabled by default.
bool ack_timeout_enabled_;
« no previous file with comments | « content/browser/renderer_host/input/input_router_impl.cc ('k') | content/browser/renderer_host/input/touch_event_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698