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

Side by Side Diff: content/browser/renderer_host/input/passthrough_touch_event_queue.h

Issue 2816613003: Add suppresion of slop region touches in browser (Closed)
Patch Set: Rebase Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/renderer_host/input/passthrough_touch_event_queue.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_PASSTHROUGH_TOUCH_EVENT_QUEUE_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_PASSTHROUGH_TOUCH_EVENT_QUEUE_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_PASSTHROUGH_TOUCH_EVENT_QUEUE_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_PASSTHROUGH_TOUCH_EVENT_QUEUE_H_
7 7
8 #include "content/browser/renderer_host/input/touch_event_queue.h" 8 #include "content/browser/renderer_host/input/touch_event_queue.h"
9 9
10 #include <set> 10 #include <set>
11 11
12 namespace content { 12 namespace content {
13 13
14 class TouchTimeoutHandler; 14 class TouchTimeoutHandler;
15 class TouchMoveSlopSuppressor;
15 16
16 // A queue that processes a touch-event and forwards it on to the 17 // A queue that processes a touch-event and forwards it on to the
17 // renderer process immediately. This class assumes that queueing will 18 // renderer process immediately. This class assumes that queueing will
18 // happen inside the renderer process. This class will hold onto the pending 19 // happen inside the renderer process. This class will hold onto the pending
19 // events so that it can re-order the acks so that they appear in a 20 // events so that it can re-order the acks so that they appear in a
20 // logical order to the rest of the browser process. Due to the threaded 21 // logical order to the rest of the browser process. Due to the threaded
21 // model of the renderer it is possible that an ack for a touchend can 22 // model of the renderer it is possible that an ack for a touchend can
22 // be sent before the corresponding ack for the touchstart. This class 23 // be sent before the corresponding ack for the touchstart. This class
23 // corrects that state. 24 // corrects that state.
24 class CONTENT_EXPORT PassthroughTouchEventQueue : public TouchEventQueue { 25 class CONTENT_EXPORT PassthroughTouchEventQueue : public TouchEventQueue {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // Whether any pointer in the touch sequence may have having a consumer. 109 // Whether any pointer in the touch sequence may have having a consumer.
109 bool maybe_has_handler_for_current_sequence_; 110 bool maybe_has_handler_for_current_sequence_;
110 111
111 // Whether to allow any remaining touches for the current sequence. Note that 112 // Whether to allow any remaining touches for the current sequence. Note that
112 // this is a stricter condition than an empty |touch_consumer_states_|, as it 113 // this is a stricter condition than an empty |touch_consumer_states_|, as it
113 // also prevents forwarding of touchstart events for new pointers in the 114 // also prevents forwarding of touchstart events for new pointers in the
114 // current sequence. This is only used when the event is synthetically 115 // current sequence. This is only used when the event is synthetically
115 // cancelled after a touch timeout. 116 // cancelled after a touch timeout.
116 bool drop_remaining_touches_in_sequence_; 117 bool drop_remaining_touches_in_sequence_;
117 118
119 // Suppresses TouchMove's within a slop region when a sequence has not yet
120 // been preventDefaulted.
121 std::unique_ptr<TouchMoveSlopSuppressor> touchmove_slop_suppressor_;
122
118 // Optional handler for timed-out touch event acks. 123 // Optional handler for timed-out touch event acks.
119 std::unique_ptr<TouchTimeoutHandler> timeout_handler_; 124 std::unique_ptr<TouchTimeoutHandler> timeout_handler_;
120 125
121 // Whether touch events should be sent as uncancelable or not. 126 // Whether touch events should be sent as uncancelable or not.
122 bool send_touch_events_async_; 127 bool send_touch_events_async_;
123 128
124 bool processing_acks_; 129 bool processing_acks_;
125 130
126 // Event is saved to compare pointer positions for new touchmove events. 131 // Event is saved to compare pointer positions for new touchmove events.
127 std::unique_ptr<blink::WebTouchEvent> last_sent_touchevent_; 132 std::unique_ptr<blink::WebTouchEvent> last_sent_touchevent_;
128 133
129 // Stores outstanding touches that have been sent to the renderer but have 134 // Stores outstanding touches that have been sent to the renderer but have
130 // not yet been ack'd by the renderer. The set is explicitly ordered based 135 // not yet been ack'd by the renderer. The set is explicitly ordered based
131 // on the unique touch event id. 136 // on the unique touch event id.
132 std::set<TouchEventWithLatencyInfoAndAckState> outstanding_touches_; 137 std::set<TouchEventWithLatencyInfoAndAckState> outstanding_touches_;
133 138
134 DISALLOW_COPY_AND_ASSIGN(PassthroughTouchEventQueue); 139 DISALLOW_COPY_AND_ASSIGN(PassthroughTouchEventQueue);
135 }; 140 };
136 141
137 } // namespace content 142 } // namespace content
138 143
139 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_PASSTHROUGH_TOUCH_EVENT_QUEUE_H_ 144 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_PASSTHROUGH_TOUCH_EVENT_QUEUE_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/input/passthrough_touch_event_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698