| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 void OnTouchEventAck(const TouchEventWithLatencyInfo& event, | 88 void OnTouchEventAck(const TouchEventWithLatencyInfo& event, |
| 89 InputEventAckState ack_result) override; | 89 InputEventAckState ack_result) override; |
| 90 | 90 |
| 91 // GetureEventFilterClient | 91 // GetureEventFilterClient |
| 92 void SendGestureEventImmediately( | 92 void SendGestureEventImmediately( |
| 93 const GestureEventWithLatencyInfo& gesture_event) override; | 93 const GestureEventWithLatencyInfo& gesture_event) override; |
| 94 void OnGestureEventAck(const GestureEventWithLatencyInfo& event, | 94 void OnGestureEventAck(const GestureEventWithLatencyInfo& event, |
| 95 InputEventAckState ack_result) override; | 95 InputEventAckState ack_result) override; |
| 96 | 96 |
| 97 bool SendMoveCaret(scoped_ptr<IPC::Message> message); | 97 bool SendMoveCaret(scoped_ptr<IPC::Message> message); |
| 98 bool SendSelectRange(scoped_ptr<IPC::Message> message); | 98 bool SendSelectMessage(scoped_ptr<IPC::Message> message); |
| 99 bool Send(IPC::Message* message); | 99 bool Send(IPC::Message* message); |
| 100 | 100 |
| 101 // Filters and forwards |input_event| to the appropriate handler. | 101 // Filters and forwards |input_event| to the appropriate handler. |
| 102 void FilterAndSendWebInputEvent(const blink::WebInputEvent& input_event, | 102 void FilterAndSendWebInputEvent(const blink::WebInputEvent& input_event, |
| 103 const ui::LatencyInfo& latency_info, | 103 const ui::LatencyInfo& latency_info, |
| 104 bool is_keyboard_shortcut); | 104 bool is_keyboard_shortcut); |
| 105 | 105 |
| 106 // Utility routine for filtering and forwarding |input_event| to the | 106 // Utility routine for filtering and forwarding |input_event| to the |
| 107 // appropriate handler. |input_event| will be offered to the overscroll | 107 // appropriate handler. |input_event| will be offered to the overscroll |
| 108 // controller, client and renderer, in that order. | 108 // controller, client and renderer, in that order. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 | 141 |
| 142 // Given a Touchpad GesturePinchUpdate event, create and send a synthetic | 142 // Given a Touchpad GesturePinchUpdate event, create and send a synthetic |
| 143 // wheel event for it. | 143 // wheel event for it. |
| 144 void SendSyntheticWheelEventForPinch( | 144 void SendSyntheticWheelEventForPinch( |
| 145 const GestureEventWithLatencyInfo& pinch_event); | 145 const GestureEventWithLatencyInfo& pinch_event); |
| 146 | 146 |
| 147 // IPC message handlers | 147 // IPC message handlers |
| 148 void OnInputEventAck(const InputHostMsg_HandleInputEvent_ACK_Params& ack); | 148 void OnInputEventAck(const InputHostMsg_HandleInputEvent_ACK_Params& ack); |
| 149 void OnDidOverscroll(const DidOverscrollParams& params); | 149 void OnDidOverscroll(const DidOverscrollParams& params); |
| 150 void OnMsgMoveCaretAck(); | 150 void OnMsgMoveCaretAck(); |
| 151 void OnSelectRangeAck(); | 151 void OnSelectMessageAck(); |
| 152 void OnHasTouchEventHandlers(bool has_handlers); | 152 void OnHasTouchEventHandlers(bool has_handlers); |
| 153 void OnSetTouchAction(TouchAction touch_action); | 153 void OnSetTouchAction(TouchAction touch_action); |
| 154 | 154 |
| 155 // Indicates the source of an ack provided to |ProcessInputEventAck()|. | 155 // Indicates the source of an ack provided to |ProcessInputEventAck()|. |
| 156 // The source is tracked by |current_ack_source_|, which aids in ack routing. | 156 // The source is tracked by |current_ack_source_|, which aids in ack routing. |
| 157 enum AckSource { | 157 enum AckSource { |
| 158 RENDERER, | 158 RENDERER, |
| 159 CLIENT, | 159 CLIENT, |
| 160 IGNORING_DISPOSITION, | 160 IGNORING_DISPOSITION, |
| 161 ACK_SOURCE_NONE | 161 ACK_SOURCE_NONE |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 bool IsInOverscrollGesture() const; | 205 bool IsInOverscrollGesture() const; |
| 206 | 206 |
| 207 int routing_id() const { return routing_id_; } | 207 int routing_id() const { return routing_id_; } |
| 208 | 208 |
| 209 | 209 |
| 210 IPC::Sender* sender_; | 210 IPC::Sender* sender_; |
| 211 InputRouterClient* client_; | 211 InputRouterClient* client_; |
| 212 InputAckHandler* ack_handler_; | 212 InputAckHandler* ack_handler_; |
| 213 int routing_id_; | 213 int routing_id_; |
| 214 | 214 |
| 215 // (Similar to |mouse_move_pending_|.) True while waiting for SelectRange_ACK. | 215 // (Similar to |mouse_move_pending_|.) True while waiting for SelectRange_ACK |
| 216 bool select_range_pending_; | 216 // or MoveRangeSelectionExtent_ACK. |
| 217 bool select_message_pending_; |
| 217 | 218 |
| 218 // (Similar to |next_mouse_move_|.) The next SelectRange to send, if any. | 219 // Queue of pending select messages to send after receving the next select |
| 219 scoped_ptr<IPC::Message> next_selection_range_; | 220 // message ack. |
| 221 std::deque<IPC::Message*> pending_select_messages_; |
| 220 | 222 |
| 221 // (Similar to |mouse_move_pending_|.) True while waiting for MoveCaret_ACK. | 223 // (Similar to |mouse_move_pending_|.) True while waiting for MoveCaret_ACK. |
| 222 bool move_caret_pending_; | 224 bool move_caret_pending_; |
| 223 | 225 |
| 224 // (Similar to |next_mouse_move_|.) The next MoveCaret to send, if any. | 226 // (Similar to |next_mouse_move_|.) The next MoveCaret to send, if any. |
| 225 scoped_ptr<IPC::Message> next_move_caret_; | 227 scoped_ptr<IPC::Message> next_move_caret_; |
| 226 | 228 |
| 227 // True if a mouse move event was sent to the render view and we are waiting | 229 // True if a mouse move event was sent to the render view and we are waiting |
| 228 // for a corresponding InputHostMsg_HandleInputEvent_ACK message. | 230 // for a corresponding InputHostMsg_HandleInputEvent_ACK message. |
| 229 bool mouse_move_pending_; | 231 bool mouse_move_pending_; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 TouchActionFilter touch_action_filter_; | 274 TouchActionFilter touch_action_filter_; |
| 273 InputEventStreamValidator input_stream_validator_; | 275 InputEventStreamValidator input_stream_validator_; |
| 274 InputEventStreamValidator output_stream_validator_; | 276 InputEventStreamValidator output_stream_validator_; |
| 275 | 277 |
| 276 DISALLOW_COPY_AND_ASSIGN(InputRouterImpl); | 278 DISALLOW_COPY_AND_ASSIGN(InputRouterImpl); |
| 277 }; | 279 }; |
| 278 | 280 |
| 279 } // namespace content | 281 } // namespace content |
| 280 | 282 |
| 281 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ | 283 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_INPUT_ROUTER_IMPL_H_ |
| OLD | NEW |