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