| 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_IMMEDIATE_INPUT_ROUTER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_IMMEDIATE_INPUT_ROUTER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_IMMEDIATE_INPUT_ROUTER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_IMMEDIATE_INPUT_ROUTER_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 } | 71 } |
| 72 | 72 |
| 73 TouchEventQueue* touch_event_queue() { | 73 TouchEventQueue* touch_event_queue() { |
| 74 return touch_event_queue_.get(); | 74 return touch_event_queue_.get(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 friend class ImmediateInputRouterTest; | 78 friend class ImmediateInputRouterTest; |
| 79 | 79 |
| 80 // TouchEventQueueClient | 80 // TouchEventQueueClient |
| 81 virtual void OnTouchEventAck(const TouchEventWithLatencyInfo& event, | 81 virtual void OnTouchEventAck(const WebKit::WebTouchEvent& event, |
| 82 InputEventAckState ack_result) OVERRIDE; | 82 InputEventAckState ack_result, |
| 83 ui::LatencyInfo* latency) OVERRIDE; |
| 83 | 84 |
| 84 bool SendMoveCaret(scoped_ptr<IPC::Message> message); | 85 bool SendMoveCaret(scoped_ptr<IPC::Message> message); |
| 85 bool SendSelectRange(scoped_ptr<IPC::Message> message); | 86 bool SendSelectRange(scoped_ptr<IPC::Message> message); |
| 86 bool Send(IPC::Message* message); | 87 bool Send(IPC::Message* message); |
| 87 | 88 |
| 88 // Transmits the given input event an as an IPC::Message. This is an internal | 89 // Transmits the given input event an as an IPC::Message. This is an internal |
| 89 // helper for |FilterAndSendInputEvent()| and should not be used otherwise. | 90 // helper for |FilterAndSendInputEvent()| and should not be used otherwise. |
| 90 void SendWebInputEvent(const WebKit::WebInputEvent& input_event, | 91 void SendWebInputEvent(const WebKit::WebInputEvent& input_event, |
| 91 const ui::LatencyInfo& latency_info, | 92 const ui::LatencyInfo& latency_info, |
| 92 bool is_keyboard_shortcut); | 93 bool is_keyboard_shortcut); |
| 93 | 94 |
| 94 // Filters and forwards the given WebInputEvent to |SendWebInputEvent()|. This | 95 // Filters and forwards the given WebInputEvent to |SendWebInputEvent()|. This |
| 95 // is an internal helper for |Send*Event()| and should not be used otherwise. | 96 // is an internal helper for |Send*Event()| and should not be used otherwise. |
| 96 void FilterAndSendWebInputEvent(const WebKit::WebInputEvent& input_event, | 97 void FilterAndSendWebInputEvent(const WebKit::WebInputEvent& input_event, |
| 97 const ui::LatencyInfo& latency_info, | 98 const ui::LatencyInfo& latency_info, |
| 98 bool is_keyboard_shortcut); | 99 bool is_keyboard_shortcut); |
| 99 | 100 |
| 100 // IPC message handlers | 101 // IPC message handlers |
| 101 void OnInputEventAck(WebKit::WebInputEvent::Type event_type, | 102 void OnInputEventAck(WebKit::WebInputEvent::Type event_type, |
| 102 InputEventAckState ack_result, | 103 InputEventAckState ack_result, |
| 103 const ui::LatencyInfo& latency_info); | 104 ui::LatencyInfo latency_info); |
| 104 void OnMsgMoveCaretAck(); | 105 void OnMsgMoveCaretAck(); |
| 105 void OnSelectRangeAck(); | 106 void OnSelectRangeAck(); |
| 106 void OnHasTouchEventHandlers(bool has_handlers); | 107 void OnHasTouchEventHandlers(bool has_handlers); |
| 107 | 108 |
| 108 // Handle the event ack. Triggered via |OnInputEventAck()| if the event was | 109 // Handle the event ack. Triggered via |OnInputEventAck()| if the event was |
| 109 // processed in the renderer, or synchonously from |FilterAndSendInputevent()| | 110 // processed in the renderer, or synchonously from |FilterAndSendInputevent()| |
| 110 // if the event was filtered by the |client_| prior to sending. | 111 // if the event was filtered by the |client_| prior to sending. |
| 111 void ProcessInputEventAck(WebKit::WebInputEvent::Type event_type, | 112 void ProcessInputEventAck(WebKit::WebInputEvent::Type event_type, |
| 112 InputEventAckState ack_result, | 113 InputEventAckState ack_result, |
| 113 const ui::LatencyInfo& latency_info); | 114 ui::LatencyInfo* latency_info); |
| 114 | 115 |
| 115 // Called by ProcessInputEventAck() to process a keyboard event ack message. | 116 // Called by ProcessInputEventAck() to process a keyboard event ack message. |
| 116 void ProcessKeyboardAck(int type, InputEventAckState ack_result); | 117 void ProcessKeyboardAck(int type, InputEventAckState ack_result); |
| 117 | 118 |
| 118 // Called by ProcessInputEventAck() to process a wheel event ack message. | 119 // Called by ProcessInputEventAck() to process a wheel event ack message. |
| 119 // This could result in a task being posted to allow additional wheel | 120 // This could result in a task being posted to allow additional wheel |
| 120 // input messages to be coalesced. | 121 // input messages to be coalesced. |
| 121 void ProcessWheelAck(InputEventAckState ack_result); | 122 void ProcessWheelAck(InputEventAckState ack_result, |
| 123 ui::LatencyInfo* latency_info); |
| 122 | 124 |
| 123 // Called by ProcessInputEventAck() to process a gesture event ack message. | 125 // Called by ProcessInputEventAck() to process a gesture event ack message. |
| 124 // This validates the gesture for suppression of touchpad taps and sends one | 126 // This validates the gesture for suppression of touchpad taps and sends one |
| 125 // previously queued coalesced gesture if it exists. | 127 // previously queued coalesced gesture if it exists. |
| 126 void ProcessGestureAck(int type, InputEventAckState ack_result); | 128 void ProcessGestureAck(int type, |
| 129 InputEventAckState ack_result, |
| 130 ui::LatencyInfo* latency); |
| 127 | 131 |
| 128 // Called on ProcessInputEventAck() to process a touch event ack message. | 132 // Called on ProcessInputEventAck() to process a touch event ack message. |
| 129 // This can result in a gesture event being generated and sent back to the | 133 // This can result in a gesture event being generated and sent back to the |
| 130 // renderer. | 134 // renderer. |
| 131 void ProcessTouchAck(InputEventAckState ack_result, | 135 void ProcessTouchAck(InputEventAckState ack_result, |
| 132 const ui::LatencyInfo& latency_info); | 136 ui::LatencyInfo* latency_info); |
| 133 | 137 |
| 134 void HandleGestureScroll( | 138 void HandleGestureScroll( |
| 135 const GestureEventWithLatencyInfo& gesture_event); | 139 const GestureEventWithLatencyInfo& gesture_event); |
| 136 | 140 |
| 137 int routing_id() const { return routing_id_; } | 141 int routing_id() const { return routing_id_; } |
| 138 | 142 |
| 139 | 143 |
| 140 RenderProcessHost* process_; | 144 RenderProcessHost* process_; |
| 141 InputRouterClient* client_; | 145 InputRouterClient* client_; |
| 142 InputAckHandler* ack_handler_; | 146 InputAckHandler* ack_handler_; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 204 |
| 201 scoped_ptr<TouchEventQueue> touch_event_queue_; | 205 scoped_ptr<TouchEventQueue> touch_event_queue_; |
| 202 scoped_ptr<GestureEventFilter> gesture_event_filter_; | 206 scoped_ptr<GestureEventFilter> gesture_event_filter_; |
| 203 | 207 |
| 204 DISALLOW_COPY_AND_ASSIGN(ImmediateInputRouter); | 208 DISALLOW_COPY_AND_ASSIGN(ImmediateInputRouter); |
| 205 }; | 209 }; |
| 206 | 210 |
| 207 } // namespace content | 211 } // namespace content |
| 208 | 212 |
| 209 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_IMMEDIATE_INPUT_ROUTER_H_ | 213 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_IMMEDIATE_INPUT_ROUTER_H_ |
| OLD | NEW |