| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 const TouchEventWithLatencyInfo& touch_event) OVERRIDE; | 70 const TouchEventWithLatencyInfo& touch_event) OVERRIDE; |
| 71 virtual const NativeWebKeyboardEvent* GetLastKeyboardEvent() const OVERRIDE; | 71 virtual const NativeWebKeyboardEvent* GetLastKeyboardEvent() const OVERRIDE; |
| 72 virtual bool ShouldForwardTouchEvent() const OVERRIDE; | 72 virtual bool ShouldForwardTouchEvent() const OVERRIDE; |
| 73 virtual void OnViewUpdated(int view_flags) OVERRIDE; | 73 virtual void OnViewUpdated(int view_flags) OVERRIDE; |
| 74 | 74 |
| 75 // IPC::Listener | 75 // IPC::Listener |
| 76 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 76 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 friend class InputRouterImplTest; | 79 friend class InputRouterImplTest; |
| 80 friend class MockRenderWidgetHost; | |
| 81 | 80 |
| 82 // TouchpadTapSuppressionControllerClient | 81 // TouchpadTapSuppressionControllerClient |
| 83 virtual void SendMouseEventImmediately( | 82 virtual void SendMouseEventImmediately( |
| 84 const MouseEventWithLatencyInfo& mouse_event) OVERRIDE; | 83 const MouseEventWithLatencyInfo& mouse_event) OVERRIDE; |
| 85 | 84 |
| 86 // TouchEventQueueClient | 85 // TouchEventQueueClient |
| 87 virtual void SendTouchEventImmediately( | 86 virtual void SendTouchEventImmediately( |
| 88 const TouchEventWithLatencyInfo& touch_event) OVERRIDE; | 87 const TouchEventWithLatencyInfo& touch_event) OVERRIDE; |
| 89 virtual void OnTouchEventAck(const TouchEventWithLatencyInfo& event, | 88 virtual void OnTouchEventAck(const TouchEventWithLatencyInfo& event, |
| 90 InputEventAckState ack_result) OVERRIDE; | 89 InputEventAckState ack_result) OVERRIDE; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 void OnMsgMoveCaretAck(); | 151 void OnMsgMoveCaretAck(); |
| 153 void OnSelectRangeAck(); | 152 void OnSelectRangeAck(); |
| 154 void OnHasTouchEventHandlers(bool has_handlers); | 153 void OnHasTouchEventHandlers(bool has_handlers); |
| 155 void OnSetTouchAction(TouchAction touch_action); | 154 void OnSetTouchAction(TouchAction touch_action); |
| 156 | 155 |
| 157 // Indicates the source of an ack provided to |ProcessInputEventAck()|. | 156 // Indicates the source of an ack provided to |ProcessInputEventAck()|. |
| 158 // The source is tracked by |current_ack_source_|, which aids in ack routing. | 157 // The source is tracked by |current_ack_source_|, which aids in ack routing. |
| 159 enum AckSource { | 158 enum AckSource { |
| 160 RENDERER, | 159 RENDERER, |
| 161 CLIENT, | 160 CLIENT, |
| 162 OVERSCROLL_CONTROLLER, | |
| 163 IGNORING_DISPOSITION, | 161 IGNORING_DISPOSITION, |
| 164 ACK_SOURCE_NONE | 162 ACK_SOURCE_NONE |
| 165 }; | 163 }; |
| 166 // Note: This function may result in |this| being deleted, and as such | 164 // Note: This function may result in |this| being deleted, and as such |
| 167 // should be the last method called in any internal chain of event handling. | 165 // should be the last method called in any internal chain of event handling. |
| 168 void ProcessInputEventAck(blink::WebInputEvent::Type event_type, | 166 void ProcessInputEventAck(blink::WebInputEvent::Type event_type, |
| 169 InputEventAckState ack_result, | 167 InputEventAckState ack_result, |
| 170 const ui::LatencyInfo& latency_info, | 168 const ui::LatencyInfo& latency_info, |
| 171 AckSource ack_source); | 169 AckSource ack_source); |
| 172 | 170 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 187 // dispatch of queued gesture events. | 185 // dispatch of queued gesture events. |
| 188 void ProcessGestureAck(blink::WebInputEvent::Type type, | 186 void ProcessGestureAck(blink::WebInputEvent::Type type, |
| 189 InputEventAckState ack_result, | 187 InputEventAckState ack_result, |
| 190 const ui::LatencyInfo& latency); | 188 const ui::LatencyInfo& latency); |
| 191 | 189 |
| 192 // Forwards the event ack to |touch_event_queue_|, potentially triggering | 190 // Forwards the event ack to |touch_event_queue_|, potentially triggering |
| 193 // dispatch of queued touch events, or the creation of gesture events. | 191 // dispatch of queued touch events, or the creation of gesture events. |
| 194 void ProcessTouchAck(InputEventAckState ack_result, | 192 void ProcessTouchAck(InputEventAckState ack_result, |
| 195 const ui::LatencyInfo& latency); | 193 const ui::LatencyInfo& latency); |
| 196 | 194 |
| 197 // Forwards |ack_result| to the client's OverscrollController, if necessary. | |
| 198 void ProcessAckForOverscroll(const blink::WebInputEvent& event, | |
| 199 InputEventAckState ack_result); | |
| 200 | |
| 201 // Called when a touch timeout-affecting bit has changed, in turn toggling the | 195 // Called when a touch timeout-affecting bit has changed, in turn toggling the |
| 202 // touch ack timeout feature of the |touch_event_queue_| as appropriate. Input | 196 // touch ack timeout feature of the |touch_event_queue_| as appropriate. Input |
| 203 // to that determination includes current view properties and the allowed | 197 // to that determination includes current view properties and the allowed |
| 204 // touch action. Note that this will only affect platforms that have a | 198 // touch action. Note that this will only affect platforms that have a |
| 205 // non-zero touch timeout configuration. | 199 // non-zero touch timeout configuration. |
| 206 void UpdateTouchAckTimeoutEnabled(); | 200 void UpdateTouchAckTimeoutEnabled(); |
| 207 | 201 |
| 208 // If a flush has been requested, signals a completed flush to the client if | 202 // If a flush has been requested, signals a completed flush to the client if |
| 209 // all events have been dispatched (i.e., |HasPendingEvents()| is false). | 203 // all events have been dispatched (i.e., |HasPendingEvents()| is false). |
| 210 void SignalFlushedIfNecessary(); | 204 void SignalFlushedIfNecessary(); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 GestureEventQueue gesture_event_queue_; | 274 GestureEventQueue gesture_event_queue_; |
| 281 TouchActionFilter touch_action_filter_; | 275 TouchActionFilter touch_action_filter_; |
| 282 InputEventStreamValidator event_stream_validator_; | 276 InputEventStreamValidator event_stream_validator_; |
| 283 | 277 |
| 284 DISALLOW_COPY_AND_ASSIGN(InputRouterImpl); | 278 DISALLOW_COPY_AND_ASSIGN(InputRouterImpl); |
| 285 }; | 279 }; |
| 286 | 280 |
| 287 } // namespace content | 281 } // namespace content |
| 288 | 282 |
| 289 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ | 283 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ |
| OLD | NEW |