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

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: Fix the tests 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
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 // Suppression of TouchMove's within a slop region when a sequence has not yet
tdresser 2017/04/13 18:13:35 Suppression of -> Suppresses
Navid Zolghadr 2017/04/18 14:47:41 Done.
120 // been preventDefaulted.
121 std::unique_ptr<TouchMoveSlopSuppressor> touchmove_slop_suppressor_;
tdresser 2017/04/13 18:13:35 Why use a unique_ptr here, instead of just stack a
Navid Zolghadr 2017/04/18 14:47:41 If I don't use pointers here I need to put the ful
tdresser 2017/04/18 15:20:26 Acknowledged.
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 // Event is saved to compare pointer positions for new touchmove events. 129 // Event is saved to compare pointer positions for new touchmove events.
125 std::unique_ptr<blink::WebTouchEvent> last_sent_touchevent_; 130 std::unique_ptr<blink::WebTouchEvent> last_sent_touchevent_;
126 131
127 // Stores outstanding touches that have been sent to the renderer but have 132 // Stores outstanding touches that have been sent to the renderer but have
128 // not yet been ack'd by the renderer. The set is explicitly ordered based 133 // not yet been ack'd by the renderer. The set is explicitly ordered based
129 // on the unique touch event id. 134 // on the unique touch event id.
130 std::set<TouchEventWithLatencyInfoAndAckState> outstanding_touches_; 135 std::set<TouchEventWithLatencyInfoAndAckState> outstanding_touches_;
131 136
132 DISALLOW_COPY_AND_ASSIGN(PassthroughTouchEventQueue); 137 DISALLOW_COPY_AND_ASSIGN(PassthroughTouchEventQueue);
133 }; 138 };
134 139
135 } // namespace content 140 } // namespace content
136 141
137 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_PASSTHROUGH_TOUCH_EVENT_QUEUE_H_ 142 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_PASSTHROUGH_TOUCH_EVENT_QUEUE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698