OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_INPUT_ROUTER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
135 // Indicates the source of an ack provided to |ProcessInputEventAck()|. | 135 // Indicates the source of an ack provided to |ProcessInputEventAck()|. |
136 // The source is tracked by |current_ack_source_|, which aids in ack routing. | 136 // The source is tracked by |current_ack_source_|, which aids in ack routing. |
137 enum AckSource { | 137 enum AckSource { |
138 RENDERER, | 138 RENDERER, |
139 CLIENT, | 139 CLIENT, |
140 IGNORING_DISPOSITION, | 140 IGNORING_DISPOSITION, |
141 ACK_SOURCE_NONE | 141 ACK_SOURCE_NONE |
142 }; | 142 }; |
143 // Note: This function may result in |this| being deleted, and as such | 143 // Note: This function may result in |this| being deleted, and as such |
144 // should be the last method called in any internal chain of event handling. | 144 // should be the last method called in any internal chain of event handling. |
145 void ProcessInputEventAck(blink::WebInputEvent::Type event_type, | 145 void ProcessInputEventAck(blink::WebInputEvent::Type event_type, |
jdduke (slow)
2015/05/01 19:11:09
What if we add a
struct InputEventAck {
type, s
| |
146 InputEventAckState ack_result, | 146 InputEventAckState ack_result, |
147 const ui::LatencyInfo& latency_info, | 147 const ui::LatencyInfo& latency_info, |
148 const uint32 unique_touch_event_id, | |
148 AckSource ack_source); | 149 AckSource ack_source); |
149 | 150 |
150 // Dispatches the ack'ed event to |ack_handler_|. | 151 // Dispatches the ack'ed event to |ack_handler_|. |
151 void ProcessKeyboardAck(blink::WebInputEvent::Type type, | 152 void ProcessKeyboardAck(blink::WebInputEvent::Type type, |
152 InputEventAckState ack_result); | 153 InputEventAckState ack_result); |
153 | 154 |
154 // Forwards a valid |next_mouse_move_| if |type| is MouseMove. | 155 // Forwards a valid |next_mouse_move_| if |type| is MouseMove. |
155 void ProcessMouseAck(blink::WebInputEvent::Type type, | 156 void ProcessMouseAck(blink::WebInputEvent::Type type, |
156 InputEventAckState ack_result); | 157 InputEventAckState ack_result); |
157 | 158 |
158 // Dispatches the ack'ed event to |ack_handler_|, forwarding queued events | 159 // Dispatches the ack'ed event to |ack_handler_|, forwarding queued events |
159 // from |coalesced_mouse_wheel_events_|. | 160 // from |coalesced_mouse_wheel_events_|. |
160 void ProcessWheelAck(InputEventAckState ack_result, | 161 void ProcessWheelAck(InputEventAckState ack_result, |
161 const ui::LatencyInfo& latency); | 162 const ui::LatencyInfo& latency); |
162 | 163 |
163 // Forwards the event ack to |gesture_event_queue|, potentially triggering | 164 // Forwards the event ack to |gesture_event_queue|, potentially triggering |
164 // dispatch of queued gesture events. | 165 // dispatch of queued gesture events. |
165 void ProcessGestureAck(blink::WebInputEvent::Type type, | 166 void ProcessGestureAck(blink::WebInputEvent::Type type, |
166 InputEventAckState ack_result, | 167 InputEventAckState ack_result, |
167 const ui::LatencyInfo& latency); | 168 const ui::LatencyInfo& latency); |
168 | 169 |
169 // Forwards the event ack to |touch_event_queue_|, potentially triggering | 170 // Forwards the event ack to |touch_event_queue_|, potentially triggering |
170 // dispatch of queued touch events, or the creation of gesture events. | 171 // dispatch of queued touch events, or the creation of gesture events. |
171 void ProcessTouchAck(InputEventAckState ack_result, | 172 void ProcessTouchAck(InputEventAckState ack_result, |
172 const ui::LatencyInfo& latency); | 173 const ui::LatencyInfo& latency, |
174 const uint32 unique_touch_event_id); | |
173 | 175 |
174 // Called when a touch timeout-affecting bit has changed, in turn toggling the | 176 // Called when a touch timeout-affecting bit has changed, in turn toggling the |
175 // touch ack timeout feature of the |touch_event_queue_| as appropriate. Input | 177 // touch ack timeout feature of the |touch_event_queue_| as appropriate. Input |
176 // to that determination includes current view properties and the allowed | 178 // to that determination includes current view properties and the allowed |
177 // touch action. Note that this will only affect platforms that have a | 179 // touch action. Note that this will only affect platforms that have a |
178 // non-zero touch timeout configuration. | 180 // non-zero touch timeout configuration. |
179 void UpdateTouchAckTimeoutEnabled(); | 181 void UpdateTouchAckTimeoutEnabled(); |
180 | 182 |
181 // If a flush has been requested, signals a completed flush to the client if | 183 // If a flush has been requested, signals a completed flush to the client if |
182 // all events have been dispatched (i.e., |HasPendingEvents()| is false). | 184 // all events have been dispatched (i.e., |HasPendingEvents()| is false). |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
252 TouchActionFilter touch_action_filter_; | 254 TouchActionFilter touch_action_filter_; |
253 InputEventStreamValidator input_stream_validator_; | 255 InputEventStreamValidator input_stream_validator_; |
254 InputEventStreamValidator output_stream_validator_; | 256 InputEventStreamValidator output_stream_validator_; |
255 | 257 |
256 DISALLOW_COPY_AND_ASSIGN(InputRouterImpl); | 258 DISALLOW_COPY_AND_ASSIGN(InputRouterImpl); |
257 }; | 259 }; |
258 | 260 |
259 } // namespace content | 261 } // namespace content |
260 | 262 |
261 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ | 263 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ |
OLD | NEW |