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