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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 SendMouseEvent(const MouseEventWithLatencyInfo& mouse_event) override; | 59 void SendMouseEvent(const MouseEventWithLatencyInfo& mouse_event) override; |
60 void SendWheelEvent( | 60 void SendWheelEvent( |
61 const MouseWheelEventWithLatencyInfo& wheel_event) override; | 61 const MouseWheelEventWithLatencyInfo& wheel_event) override; |
62 void SendKeyboardEvent(const NativeWebKeyboardEventWithLatencyInfo& key_event, | 62 void SendKeyboardEvent( |
63 bool is_keyboard_shortcut) override; | 63 const NativeWebKeyboardEventWithLatencyInfo& key_event) override; |
64 void SendGestureEvent( | 64 void SendGestureEvent( |
65 const GestureEventWithLatencyInfo& gesture_event) override; | 65 const GestureEventWithLatencyInfo& gesture_event) override; |
66 void SendTouchEvent(const TouchEventWithLatencyInfo& touch_event) override; | 66 void SendTouchEvent(const TouchEventWithLatencyInfo& touch_event) override; |
67 const NativeWebKeyboardEvent* GetLastKeyboardEvent() const override; | 67 const NativeWebKeyboardEvent* GetLastKeyboardEvent() const override; |
68 void NotifySiteIsMobileOptimized(bool is_mobile_optimized) override; | 68 void NotifySiteIsMobileOptimized(bool is_mobile_optimized) override; |
69 void RequestNotificationWhenFlushed() 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; |
(...skipping 16 matching lines...) Expand all Loading... |
90 const GestureEventWithLatencyInfo& gesture_event) override; | 90 const GestureEventWithLatencyInfo& gesture_event) override; |
91 void OnGestureEventAck(const GestureEventWithLatencyInfo& event, | 91 void OnGestureEventAck(const GestureEventWithLatencyInfo& event, |
92 InputEventAckState ack_result) override; | 92 InputEventAckState ack_result) override; |
93 | 93 |
94 bool SendMoveCaret(scoped_ptr<IPC::Message> message); | 94 bool SendMoveCaret(scoped_ptr<IPC::Message> message); |
95 bool SendSelectMessage(scoped_ptr<IPC::Message> message); | 95 bool SendSelectMessage(scoped_ptr<IPC::Message> message); |
96 bool Send(IPC::Message* message); | 96 bool Send(IPC::Message* message); |
97 | 97 |
98 // Filters and forwards |input_event| to the appropriate handler. | 98 // Filters and forwards |input_event| to the appropriate handler. |
99 void FilterAndSendWebInputEvent(const blink::WebInputEvent& input_event, | 99 void FilterAndSendWebInputEvent(const blink::WebInputEvent& input_event, |
100 const ui::LatencyInfo& latency_info, | 100 const ui::LatencyInfo& latency_info); |
101 bool is_keyboard_shortcut); | |
102 | 101 |
103 // Utility routine for filtering and forwarding |input_event| to the | 102 // Utility routine for filtering and forwarding |input_event| to the |
104 // appropriate handler. |input_event| will be offered to the overscroll | 103 // appropriate handler. |input_event| will be offered to the overscroll |
105 // controller, client and renderer, in that order. | 104 // controller, client and renderer, in that order. |
106 void OfferToHandlers(const blink::WebInputEvent& input_event, | 105 void OfferToHandlers(const blink::WebInputEvent& input_event, |
107 const ui::LatencyInfo& latency_info, | 106 const ui::LatencyInfo& latency_info); |
108 bool is_keyboard_shortcut); | |
109 | |
110 // Returns true if |input_event| was consumed by the overscroll controller. | |
111 bool OfferToOverscrollController(const blink::WebInputEvent& input_event, | |
112 const ui::LatencyInfo& latency_info); | |
113 | 107 |
114 // Returns true if |input_event| was consumed by the client. | 108 // Returns true if |input_event| was consumed by the client. |
115 bool OfferToClient(const blink::WebInputEvent& input_event, | 109 bool OfferToClient(const blink::WebInputEvent& input_event, |
116 const ui::LatencyInfo& latency_info); | 110 const ui::LatencyInfo& latency_info); |
117 | 111 |
118 // Returns true if |input_event| was successfully sent to the renderer | 112 // Returns true if |input_event| was successfully sent to the renderer |
119 // as an async IPC Message. | 113 // as an async IPC Message. |
120 bool OfferToRenderer(const blink::WebInputEvent& input_event, | 114 bool OfferToRenderer(const blink::WebInputEvent& input_event, |
121 const ui::LatencyInfo& latency_info, | 115 const ui::LatencyInfo& latency_info); |
122 bool is_keyboard_shortcut); | |
123 | 116 |
124 // IPC message handlers | 117 // IPC message handlers |
125 void OnInputEventAck(const InputEventAck& ack); | 118 void OnInputEventAck(const InputEventAck& ack); |
126 void OnDidOverscroll(const DidOverscrollParams& params); | 119 void OnDidOverscroll(const DidOverscrollParams& params); |
127 void OnMsgMoveCaretAck(); | 120 void OnMsgMoveCaretAck(); |
128 void OnSelectMessageAck(); | 121 void OnSelectMessageAck(); |
129 void OnHasTouchEventHandlers(bool has_handlers); | 122 void OnHasTouchEventHandlers(bool has_handlers); |
130 void OnSetTouchAction(TouchAction touch_action); | 123 void OnSetTouchAction(TouchAction touch_action); |
131 void OnDidStopFlinging(); | 124 void OnDidStopFlinging(); |
132 | 125 |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 TouchActionFilter touch_action_filter_; | 250 TouchActionFilter touch_action_filter_; |
258 InputEventStreamValidator input_stream_validator_; | 251 InputEventStreamValidator input_stream_validator_; |
259 InputEventStreamValidator output_stream_validator_; | 252 InputEventStreamValidator output_stream_validator_; |
260 | 253 |
261 DISALLOW_COPY_AND_ASSIGN(InputRouterImpl); | 254 DISALLOW_COPY_AND_ASSIGN(InputRouterImpl); |
262 }; | 255 }; |
263 | 256 |
264 } // namespace content | 257 } // namespace content |
265 | 258 |
266 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ | 259 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ |
OLD | NEW |