Chromium Code Reviews| 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" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "content/browser/renderer_host/input/gesture_event_queue.h" | 13 #include "content/browser/renderer_host/input/gesture_event_queue.h" |
| 14 #include "content/browser/renderer_host/input/input_router.h" | 14 #include "content/browser/renderer_host/input/input_router.h" |
| 15 #include "content/browser/renderer_host/input/touch_action_filter.h" | 15 #include "content/browser/renderer_host/input/touch_action_filter.h" |
| 16 #include "content/browser/renderer_host/input/touch_event_queue.h" | 16 #include "content/browser/renderer_host/input/touch_event_queue.h" |
| 17 #include "content/browser/renderer_host/input/touchpad_tap_suppression_controlle r.h" | 17 #include "content/browser/renderer_host/input/touchpad_tap_suppression_controlle r.h" |
| 18 #include "content/common/input/input_event_ack.h" | |
| 18 #include "content/common/input/input_event_stream_validator.h" | 19 #include "content/common/input/input_event_stream_validator.h" |
| 19 #include "content/public/browser/native_web_keyboard_event.h" | 20 #include "content/public/browser/native_web_keyboard_event.h" |
| 20 | 21 |
| 21 struct InputHostMsg_HandleInputEvent_ACK_Params; | |
| 22 | |
| 23 namespace IPC { | 22 namespace IPC { |
| 24 class Sender; | 23 class Sender; |
| 25 } | 24 } |
| 26 | 25 |
| 27 namespace ui { | 26 namespace ui { |
| 28 struct LatencyInfo; | 27 struct LatencyInfo; |
| 29 } | 28 } |
| 30 | 29 |
| 31 namespace content { | 30 namespace content { |
| 32 | 31 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 bool OfferToClient(const blink::WebInputEvent& input_event, | 116 bool OfferToClient(const blink::WebInputEvent& input_event, |
| 118 const ui::LatencyInfo& latency_info); | 117 const ui::LatencyInfo& latency_info); |
| 119 | 118 |
| 120 // Returns true if |input_event| was successfully sent to the renderer | 119 // Returns true if |input_event| was successfully sent to the renderer |
| 121 // as an async IPC Message. | 120 // as an async IPC Message. |
| 122 bool OfferToRenderer(const blink::WebInputEvent& input_event, | 121 bool OfferToRenderer(const blink::WebInputEvent& input_event, |
| 123 const ui::LatencyInfo& latency_info, | 122 const ui::LatencyInfo& latency_info, |
| 124 bool is_keyboard_shortcut); | 123 bool is_keyboard_shortcut); |
| 125 | 124 |
| 126 // IPC message handlers | 125 // IPC message handlers |
| 127 void OnInputEventAck(const InputHostMsg_HandleInputEvent_ACK_Params& ack); | 126 void OnInputEventAck(const InputEventAck& ack); |
| 128 void OnDidOverscroll(const DidOverscrollParams& params); | 127 void OnDidOverscroll(const DidOverscrollParams& params); |
| 129 void OnMsgMoveCaretAck(); | 128 void OnMsgMoveCaretAck(); |
| 130 void OnSelectMessageAck(); | 129 void OnSelectMessageAck(); |
| 131 void OnHasTouchEventHandlers(bool has_handlers); | 130 void OnHasTouchEventHandlers(bool has_handlers); |
| 132 void OnSetTouchAction(TouchAction touch_action); | 131 void OnSetTouchAction(TouchAction touch_action); |
| 133 void OnDidStopFlinging(); | 132 void OnDidStopFlinging(); |
| 134 | 133 |
| 135 // Indicates the source of an ack provided to |ProcessInputEventAck()|. | 134 // Indicates the source of an ack provided to |ProcessInputEventAck()|. |
| 136 // The source is tracked by |current_ack_source_|, which aids in ack routing. | 135 // The source is tracked by |current_ack_source_|, which aids in ack routing. |
| 137 enum AckSource { | 136 enum AckSource { |
| 138 RENDERER, | 137 RENDERER, |
| 139 CLIENT, | 138 CLIENT, |
| 140 IGNORING_DISPOSITION, | 139 IGNORING_DISPOSITION, |
| 141 ACK_SOURCE_NONE | 140 ACK_SOURCE_NONE |
| 142 }; | 141 }; |
| 143 // Note: This function may result in |this| being deleted, and as such | 142 // 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. | 143 // should be the last method called in any internal chain of event handling. |
| 145 void ProcessInputEventAck(blink::WebInputEvent::Type event_type, | 144 void ProcessInputEventAck(const InputEventAck& ack, AckSource ack_source); |
|
jdduke (slow)
2015/05/07 21:11:15
See comments in the .cc file, I guess until we pro
| |
| 146 InputEventAckState ack_result, | |
| 147 const ui::LatencyInfo& latency_info, | |
| 148 AckSource ack_source); | |
| 149 | 145 |
| 150 // Dispatches the ack'ed event to |ack_handler_|. | 146 // Dispatches the ack'ed event to |ack_handler_|. |
| 151 void ProcessKeyboardAck(blink::WebInputEvent::Type type, | 147 void ProcessKeyboardAck(blink::WebInputEvent::Type type, |
| 152 InputEventAckState ack_result); | 148 InputEventAckState ack_result); |
| 153 | 149 |
| 154 // Forwards a valid |next_mouse_move_| if |type| is MouseMove. | 150 // Forwards a valid |next_mouse_move_| if |type| is MouseMove. |
| 155 void ProcessMouseAck(blink::WebInputEvent::Type type, | 151 void ProcessMouseAck(blink::WebInputEvent::Type type, |
| 156 InputEventAckState ack_result); | 152 InputEventAckState ack_result); |
| 157 | 153 |
| 158 // Dispatches the ack'ed event to |ack_handler_|, forwarding queued events | 154 // Dispatches the ack'ed event to |ack_handler_|, forwarding queued events |
| 159 // from |coalesced_mouse_wheel_events_|. | 155 // from |coalesced_mouse_wheel_events_|. |
| 160 void ProcessWheelAck(InputEventAckState ack_result, | 156 void ProcessWheelAck(InputEventAckState ack_result, |
| 161 const ui::LatencyInfo& latency); | 157 const ui::LatencyInfo& latency); |
| 162 | 158 |
| 163 // Forwards the event ack to |gesture_event_queue|, potentially triggering | 159 // Forwards the event ack to |gesture_event_queue|, potentially triggering |
| 164 // dispatch of queued gesture events. | 160 // dispatch of queued gesture events. |
| 165 void ProcessGestureAck(blink::WebInputEvent::Type type, | 161 void ProcessGestureAck(blink::WebInputEvent::Type type, |
| 166 InputEventAckState ack_result, | 162 InputEventAckState ack_result, |
| 167 const ui::LatencyInfo& latency); | 163 const ui::LatencyInfo& latency); |
| 168 | 164 |
| 169 // Forwards the event ack to |touch_event_queue_|, potentially triggering | 165 // Forwards the event ack to |touch_event_queue_|, potentially triggering |
| 170 // dispatch of queued touch events, or the creation of gesture events. | 166 // dispatch of queued touch events, or the creation of gesture events. |
| 171 void ProcessTouchAck(InputEventAckState ack_result, | 167 void ProcessTouchAck(InputEventAckState ack_result, |
| 172 const ui::LatencyInfo& latency); | 168 const ui::LatencyInfo& latency, |
| 169 const uint32 unique_touch_event_id); | |
| 173 | 170 |
| 174 // Called when a touch timeout-affecting bit has changed, in turn toggling the | 171 // 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 | 172 // touch ack timeout feature of the |touch_event_queue_| as appropriate. Input |
| 176 // to that determination includes current view properties and the allowed | 173 // to that determination includes current view properties and the allowed |
| 177 // touch action. Note that this will only affect platforms that have a | 174 // touch action. Note that this will only affect platforms that have a |
| 178 // non-zero touch timeout configuration. | 175 // non-zero touch timeout configuration. |
| 179 void UpdateTouchAckTimeoutEnabled(); | 176 void UpdateTouchAckTimeoutEnabled(); |
| 180 | 177 |
| 181 // If a flush has been requested, signals a completed flush to the client if | 178 // 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). | 179 // 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_; | 249 TouchActionFilter touch_action_filter_; |
| 253 InputEventStreamValidator input_stream_validator_; | 250 InputEventStreamValidator input_stream_validator_; |
| 254 InputEventStreamValidator output_stream_validator_; | 251 InputEventStreamValidator output_stream_validator_; |
| 255 | 252 |
| 256 DISALLOW_COPY_AND_ASSIGN(InputRouterImpl); | 253 DISALLOW_COPY_AND_ASSIGN(InputRouterImpl); |
| 257 }; | 254 }; |
| 258 | 255 |
| 259 } // namespace content | 256 } // namespace content |
| 260 | 257 |
| 261 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ | 258 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ |
| OLD | NEW |