| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 InputRouterImpl(IPC::Sender* sender, | 50 InputRouterImpl(IPC::Sender* sender, |
| 51 InputRouterClient* client, | 51 InputRouterClient* client, |
| 52 InputAckHandler* ack_handler, | 52 InputAckHandler* ack_handler, |
| 53 int routing_id, | 53 int routing_id, |
| 54 const Config& config); | 54 const Config& config); |
| 55 ~InputRouterImpl() override; | 55 ~InputRouterImpl() override; |
| 56 | 56 |
| 57 // InputRouter | 57 // InputRouter |
| 58 bool SendInput(scoped_ptr<IPC::Message> message) override; | 58 bool SendInput(scoped_ptr<IPC::Message> message) override; |
| 59 void FlushInput(base::TimeTicks flush_time) override; |
| 59 void SendMouseEvent(const MouseEventWithLatencyInfo& mouse_event) override; | 60 void SendMouseEvent(const MouseEventWithLatencyInfo& mouse_event) override; |
| 60 void SendWheelEvent( | 61 void SendWheelEvent( |
| 61 const MouseWheelEventWithLatencyInfo& wheel_event) override; | 62 const MouseWheelEventWithLatencyInfo& wheel_event) override; |
| 62 void SendKeyboardEvent( | 63 void SendKeyboardEvent( |
| 63 const NativeWebKeyboardEventWithLatencyInfo& key_event) override; | 64 const NativeWebKeyboardEventWithLatencyInfo& key_event) override; |
| 64 void SendGestureEvent( | 65 void SendGestureEvent( |
| 65 const GestureEventWithLatencyInfo& gesture_event) override; | 66 const GestureEventWithLatencyInfo& gesture_event) override; |
| 66 void SendTouchEvent(const TouchEventWithLatencyInfo& touch_event) override; | 67 void SendTouchEvent(const TouchEventWithLatencyInfo& touch_event) override; |
| 67 const NativeWebKeyboardEvent* GetLastKeyboardEvent() const override; | 68 const NativeWebKeyboardEvent* GetLastKeyboardEvent() const override; |
| 68 void NotifySiteIsMobileOptimized(bool is_mobile_optimized) override; | 69 void NotifySiteIsMobileOptimized(bool is_mobile_optimized) override; |
| 69 void RequestNotificationWhenFlushed() override; | |
| 70 bool HasPendingEvents() const override; | 70 bool HasPendingEvents() const override; |
| 71 | 71 |
| 72 // IPC::Listener | 72 // IPC::Listener |
| 73 bool OnMessageReceived(const IPC::Message& message) override; | 73 bool OnMessageReceived(const IPC::Message& message) override; |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 friend class InputRouterImplTest; | 76 friend class InputRouterImplTest; |
| 77 | 77 |
| 78 // TouchpadTapSuppressionControllerClient | 78 // TouchpadTapSuppressionControllerClient |
| 79 void SendMouseEventImmediately( | 79 void SendMouseEventImmediately( |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 const ui::LatencyInfo& latency, | 166 const ui::LatencyInfo& latency, |
| 167 uint32 unique_touch_event_id); | 167 uint32 unique_touch_event_id); |
| 168 | 168 |
| 169 // Called when a touch timeout-affecting bit has changed, in turn toggling the | 169 // Called when a touch timeout-affecting bit has changed, in turn toggling the |
| 170 // touch ack timeout feature of the |touch_event_queue_| as appropriate. Input | 170 // touch ack timeout feature of the |touch_event_queue_| as appropriate. Input |
| 171 // to that determination includes current view properties and the allowed | 171 // to that determination includes current view properties and the allowed |
| 172 // touch action. Note that this will only affect platforms that have a | 172 // touch action. Note that this will only affect platforms that have a |
| 173 // non-zero touch timeout configuration. | 173 // non-zero touch timeout configuration. |
| 174 void UpdateTouchAckTimeoutEnabled(); | 174 void UpdateTouchAckTimeoutEnabled(); |
| 175 | 175 |
| 176 // If a flush has been requested, signals a completed flush to the client if | 176 // If a flush call has been made, signals a completed flush to the client if |
| 177 // all events have been dispatched (i.e., |HasPendingEvents()| is false). | 177 // all events have been dispatched (i.e., |HasPendingEvents()| is false). |
| 178 void SignalFlushedIfNecessary(); | 178 void SignalFlushedIfNecessary(); |
| 179 | 179 |
| 180 int routing_id() const { return routing_id_; } | 180 int routing_id() const { return routing_id_; } |
| 181 | 181 |
| 182 | 182 |
| 183 IPC::Sender* sender_; | 183 IPC::Sender* sender_; |
| 184 InputRouterClient* client_; | 184 InputRouterClient* client_; |
| 185 InputAckHandler* ack_handler_; | 185 InputAckHandler* ack_handler_; |
| 186 int routing_id_; | 186 int routing_id_; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 typedef std::deque<NativeWebKeyboardEventWithLatencyInfo> KeyQueue; | 229 typedef std::deque<NativeWebKeyboardEventWithLatencyInfo> KeyQueue; |
| 230 KeyQueue key_queue_; | 230 KeyQueue key_queue_; |
| 231 | 231 |
| 232 // The time when an input event was sent to the client. | 232 // The time when an input event was sent to the client. |
| 233 base::TimeTicks input_event_start_time_; | 233 base::TimeTicks input_event_start_time_; |
| 234 | 234 |
| 235 // The source of the ack within the scope of |ProcessInputEventAck()|. | 235 // The source of the ack within the scope of |ProcessInputEventAck()|. |
| 236 // Defaults to ACK_SOURCE_NONE. | 236 // Defaults to ACK_SOURCE_NONE. |
| 237 AckSource current_ack_source_; | 237 AckSource current_ack_source_; |
| 238 | 238 |
| 239 // Whether a call to |Flush()| has yet been accompanied by a |DidFlush()| call | 239 // Whether we've received a |FlushInput()| call without yet calling |
| 240 // to the client_ after all events have been dispatched/acked. | 240 // |DidFlashAllInput()| on the client. |
| 241 bool flush_requested_; | 241 bool flush_requested_; |
| 242 | 242 |
| 243 // Whether there are any active flings in the renderer. As the fling | 243 // Whether there are any active flings in the renderer. As the fling |
| 244 // end notification is asynchronous, we use a count rather than a boolean | 244 // end notification is asynchronous, we use a count rather than a boolean |
| 245 // to avoid races in bookkeeping when starting a new fling. | 245 // to avoid races in bookkeeping when starting a new fling. |
| 246 int active_renderer_fling_count_; | 246 int active_renderer_fling_count_; |
| 247 | 247 |
| 248 TouchEventQueue touch_event_queue_; | 248 TouchEventQueue touch_event_queue_; |
| 249 GestureEventQueue gesture_event_queue_; | 249 GestureEventQueue gesture_event_queue_; |
| 250 TouchActionFilter touch_action_filter_; | 250 TouchActionFilter touch_action_filter_; |
| 251 InputEventStreamValidator input_stream_validator_; | 251 InputEventStreamValidator input_stream_validator_; |
| 252 InputEventStreamValidator output_stream_validator_; | 252 InputEventStreamValidator output_stream_validator_; |
| 253 | 253 |
| 254 DISALLOW_COPY_AND_ASSIGN(InputRouterImpl); | 254 DISALLOW_COPY_AND_ASSIGN(InputRouterImpl); |
| 255 }; | 255 }; |
| 256 | 256 |
| 257 } // namespace content | 257 } // namespace content |
| 258 | 258 |
| 259 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ | 259 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ |
| OLD | NEW |