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 | 50 |
51 InputRouterImpl(IPC::Sender* sender, | 51 InputRouterImpl(IPC::Sender* sender, |
52 InputRouterClient* client, | 52 InputRouterClient* client, |
53 InputAckHandler* ack_handler, | 53 InputAckHandler* ack_handler, |
54 int routing_id, | 54 int routing_id, |
55 const Config& config); | 55 const Config& config); |
56 ~InputRouterImpl() override; | 56 ~InputRouterImpl() override; |
57 | 57 |
58 // InputRouter | 58 // InputRouter |
59 void Flush() override; | |
60 bool SendInput(scoped_ptr<IPC::Message> message) override; | 59 bool SendInput(scoped_ptr<IPC::Message> message) override; |
61 void SendMouseEvent(const MouseEventWithLatencyInfo& mouse_event) override; | 60 void SendMouseEvent(const MouseEventWithLatencyInfo& mouse_event) override; |
62 void SendWheelEvent( | 61 void SendWheelEvent( |
63 const MouseWheelEventWithLatencyInfo& wheel_event) override; | 62 const MouseWheelEventWithLatencyInfo& wheel_event) override; |
64 void SendKeyboardEvent(const NativeWebKeyboardEvent& key_event, | 63 void SendKeyboardEvent(const NativeWebKeyboardEvent& key_event, |
65 const ui::LatencyInfo& latency_info, | 64 const ui::LatencyInfo& latency_info, |
66 bool is_keyboard_shortcut) override; | 65 bool is_keyboard_shortcut) override; |
67 void SendGestureEvent( | 66 void SendGestureEvent( |
68 const GestureEventWithLatencyInfo& gesture_event) override; | 67 const GestureEventWithLatencyInfo& gesture_event) override; |
69 void SendTouchEvent(const TouchEventWithLatencyInfo& touch_event) override; | 68 void SendTouchEvent(const TouchEventWithLatencyInfo& touch_event) override; |
| 69 void RequestFlushedNotification() override; |
70 const NativeWebKeyboardEvent* GetLastKeyboardEvent() const override; | 70 const NativeWebKeyboardEvent* GetLastKeyboardEvent() const override; |
71 bool ShouldForwardTouchEvent() const override; | 71 bool ShouldForwardTouchEvent() const override; |
72 void OnViewUpdated(int view_flags) override; | 72 void OnViewUpdated(int view_flags) override; |
73 bool HasPendingEvents() const override; | 73 bool HasPendingEvents() const override; |
74 | 74 |
75 // IPC::Listener | 75 // IPC::Listener |
76 bool OnMessageReceived(const IPC::Message& message) override; | 76 bool OnMessageReceived(const IPC::Message& message) override; |
77 | 77 |
78 private: | 78 private: |
79 friend class InputRouterImplTest; | 79 friend class InputRouterImplTest; |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 int current_view_flags_; | 262 int current_view_flags_; |
263 | 263 |
264 // The source of the ack within the scope of |ProcessInputEventAck()|. | 264 // The source of the ack within the scope of |ProcessInputEventAck()|. |
265 // Defaults to ACK_SOURCE_NONE. | 265 // Defaults to ACK_SOURCE_NONE. |
266 AckSource current_ack_source_; | 266 AckSource current_ack_source_; |
267 | 267 |
268 // Whether a call to |Flush()| has yet been accompanied by a |DidFlush()| call | 268 // Whether a call to |Flush()| has yet been accompanied by a |DidFlush()| call |
269 // to the client_ after all events have been dispatched/acked. | 269 // to the client_ after all events have been dispatched/acked. |
270 bool flush_requested_; | 270 bool flush_requested_; |
271 | 271 |
| 272 // Whether we're in the scope of destruction. The only input events that might |
| 273 // conceivably arrive when this is true are gesture events generated from |
| 274 // flushing |touch_event_queue_|, which will be summarily dropped. |
| 275 bool in_shutdown_; |
| 276 |
272 TouchEventQueue touch_event_queue_; | 277 TouchEventQueue touch_event_queue_; |
273 GestureEventQueue gesture_event_queue_; | 278 GestureEventQueue gesture_event_queue_; |
274 TouchActionFilter touch_action_filter_; | 279 TouchActionFilter touch_action_filter_; |
275 InputEventStreamValidator input_stream_validator_; | 280 InputEventStreamValidator input_stream_validator_; |
276 InputEventStreamValidator output_stream_validator_; | 281 InputEventStreamValidator output_stream_validator_; |
277 | 282 |
278 DISALLOW_COPY_AND_ASSIGN(InputRouterImpl); | 283 DISALLOW_COPY_AND_ASSIGN(InputRouterImpl); |
279 }; | 284 }; |
280 | 285 |
281 } // namespace content | 286 } // namespace content |
282 | 287 |
283 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ | 288 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ |
OLD | NEW |