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