| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 virtual void SendKeyboardEvent( | 54 virtual void SendKeyboardEvent( |
| 55 const NativeWebKeyboardEvent& key_event, | 55 const NativeWebKeyboardEvent& key_event, |
| 56 const ui::LatencyInfo& latency_info, | 56 const ui::LatencyInfo& latency_info, |
| 57 bool is_keyboard_shortcut) OVERRIDE; | 57 bool is_keyboard_shortcut) OVERRIDE; |
| 58 virtual void SendGestureEvent( | 58 virtual void SendGestureEvent( |
| 59 const GestureEventWithLatencyInfo& gesture_event) OVERRIDE; | 59 const GestureEventWithLatencyInfo& gesture_event) OVERRIDE; |
| 60 virtual void SendTouchEvent( | 60 virtual void SendTouchEvent( |
| 61 const TouchEventWithLatencyInfo& touch_event) OVERRIDE; | 61 const TouchEventWithLatencyInfo& touch_event) OVERRIDE; |
| 62 virtual const NativeWebKeyboardEvent* GetLastKeyboardEvent() const OVERRIDE; | 62 virtual const NativeWebKeyboardEvent* GetLastKeyboardEvent() const OVERRIDE; |
| 63 virtual bool ShouldForwardTouchEvent() const OVERRIDE; | 63 virtual bool ShouldForwardTouchEvent() const OVERRIDE; |
| 64 virtual void OnViewUpdated(int view_flags) OVERRIDE; |
| 64 | 65 |
| 65 // IPC::Listener | 66 // IPC::Listener |
| 66 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 67 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 67 | 68 |
| 68 private: | 69 private: |
| 69 friend class InputRouterImplTest; | 70 friend class InputRouterImplTest; |
| 70 friend class MockRenderWidgetHost; | 71 friend class MockRenderWidgetHost; |
| 71 | 72 |
| 72 // TouchpadTapSuppressionControllerClient | 73 // TouchpadTapSuppressionControllerClient |
| 73 virtual void SendMouseEventImmediately( | 74 virtual void SendMouseEventImmediately( |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 | 161 |
| 161 // Forwards the event ack to |touch_event_queue_|, potentially triggering | 162 // Forwards the event ack to |touch_event_queue_|, potentially triggering |
| 162 // dispatch of queued touch events, or the creation of gesture events. | 163 // dispatch of queued touch events, or the creation of gesture events. |
| 163 void ProcessTouchAck(InputEventAckState ack_result, | 164 void ProcessTouchAck(InputEventAckState ack_result, |
| 164 const ui::LatencyInfo& latency); | 165 const ui::LatencyInfo& latency); |
| 165 | 166 |
| 166 // Forwards |ack_result| to the client's OverscrollController, if necessary. | 167 // Forwards |ack_result| to the client's OverscrollController, if necessary. |
| 167 void ProcessAckForOverscroll(const blink::WebInputEvent& event, | 168 void ProcessAckForOverscroll(const blink::WebInputEvent& event, |
| 168 InputEventAckState ack_result); | 169 InputEventAckState ack_result); |
| 169 | 170 |
| 170 void HandleGestureScroll(const GestureEventWithLatencyInfo& gesture_event); | |
| 171 | |
| 172 void SimulateTouchGestureWithMouse( | 171 void SimulateTouchGestureWithMouse( |
| 173 const MouseEventWithLatencyInfo& mouse_event); | 172 const MouseEventWithLatencyInfo& mouse_event); |
| 174 | 173 |
| 175 bool IsInOverscrollGesture() const; | 174 bool IsInOverscrollGesture() const; |
| 176 | 175 |
| 177 int routing_id() const { return routing_id_; } | 176 int routing_id() const { return routing_id_; } |
| 178 | 177 |
| 179 | 178 |
| 180 IPC::Sender* sender_; | 179 IPC::Sender* sender_; |
| 181 InputRouterClient* client_; | 180 InputRouterClient* client_; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 // A queue of keyboard events. We can't trust data from the renderer so we | 226 // A queue of keyboard events. We can't trust data from the renderer so we |
| 228 // stuff key events into a queue and pop them out on ACK, feeding our copy | 227 // stuff key events into a queue and pop them out on ACK, feeding our copy |
| 229 // back to whatever unhandled handler instead of the returned version. | 228 // back to whatever unhandled handler instead of the returned version. |
| 230 KeyQueue key_queue_; | 229 KeyQueue key_queue_; |
| 231 | 230 |
| 232 // Keeps track of whether the webpage has any touch event handler. If it does, | 231 // Keeps track of whether the webpage has any touch event handler. If it does, |
| 233 // then touch events are sent to the renderer. Otherwise, the touch events are | 232 // then touch events are sent to the renderer. Otherwise, the touch events are |
| 234 // not sent to the renderer. | 233 // not sent to the renderer. |
| 235 bool has_touch_handler_; | 234 bool has_touch_handler_; |
| 236 | 235 |
| 236 // Whether touch ack timeout handling has been enabled via the command line. |
| 237 bool touch_ack_timeout_enabled_; |
| 238 size_t touch_ack_timeout_delay_ms_; |
| 239 |
| 237 // The source of the ack within the scope of |ProcessInputEventAck()|. | 240 // The source of the ack within the scope of |ProcessInputEventAck()|. |
| 238 // Defaults to ACK_SOURCE_NONE. | 241 // Defaults to ACK_SOURCE_NONE. |
| 239 AckSource current_ack_source_; | 242 AckSource current_ack_source_; |
| 240 | 243 |
| 241 scoped_ptr<TouchEventQueue> touch_event_queue_; | 244 scoped_ptr<TouchEventQueue> touch_event_queue_; |
| 242 scoped_ptr<GestureEventFilter> gesture_event_filter_; | 245 scoped_ptr<GestureEventFilter> gesture_event_filter_; |
| 243 | 246 |
| 244 DISALLOW_COPY_AND_ASSIGN(InputRouterImpl); | 247 DISALLOW_COPY_AND_ASSIGN(InputRouterImpl); |
| 245 }; | 248 }; |
| 246 | 249 |
| 247 } // namespace content | 250 } // namespace content |
| 248 | 251 |
| 249 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ | 252 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ |
| OLD | NEW |