| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 GestureEventFilter* gesture_event_filter() { | 67 GestureEventFilter* gesture_event_filter() { |
| 68 return gesture_event_filter_.get(); | 68 return gesture_event_filter_.get(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 TouchEventQueue* touch_event_queue() { | 71 TouchEventQueue* touch_event_queue() { |
| 72 return touch_event_queue_.get(); | 72 return touch_event_queue_.get(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 friend class ImmediateInputRouterTest; |
| 77 |
| 76 // TouchEventQueueClient | 78 // TouchEventQueueClient |
| 77 virtual void OnTouchEventAck(const TouchEventWithLatencyInfo& event, | 79 virtual void OnTouchEventAck(const TouchEventWithLatencyInfo& event, |
| 78 InputEventAckState ack_result) OVERRIDE; | 80 InputEventAckState ack_result) OVERRIDE; |
| 79 | 81 |
| 80 bool SendMoveCaret(IPC::Message* message); | 82 bool SendMoveCaret(IPC::Message* message); |
| 81 bool SendSelectRange(IPC::Message* message); | 83 bool SendSelectRange(IPC::Message* message); |
| 82 bool Send(IPC::Message* message); | 84 bool Send(IPC::Message* message); |
| 83 | 85 |
| 84 // Transmits the given input event an as an IPC::Message. This is an internal | 86 // Transmits the given input event an as an IPC::Message. This is an internal |
| 85 // helper for |FilterAndSendInputEvent()| and should not be used otherwise. | 87 // helper for |FilterAndSendInputEvent()| and should not be used otherwise. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // This validates the gesture for suppression of touchpad taps and sends one | 122 // This validates the gesture for suppression of touchpad taps and sends one |
| 121 // previously queued coalesced gesture if it exists. | 123 // previously queued coalesced gesture if it exists. |
| 122 void ProcessGestureAck(int type, InputEventAckState ack_result); | 124 void ProcessGestureAck(int type, InputEventAckState ack_result); |
| 123 | 125 |
| 124 // Called on ProcessInputEventAck() to process a touch event ack message. | 126 // Called on ProcessInputEventAck() to process a touch event ack message. |
| 125 // This can result in a gesture event being generated and sent back to the | 127 // This can result in a gesture event being generated and sent back to the |
| 126 // renderer. | 128 // renderer. |
| 127 void ProcessTouchAck(InputEventAckState ack_result, | 129 void ProcessTouchAck(InputEventAckState ack_result, |
| 128 const ui::LatencyInfo& latency_info); | 130 const ui::LatencyInfo& latency_info); |
| 129 | 131 |
| 132 void HandleGestureScroll( |
| 133 const GestureEventWithLatencyInfo& gesture_event); |
| 134 |
| 130 int routing_id() const { return routing_id_; } | 135 int routing_id() const { return routing_id_; } |
| 131 | 136 |
| 132 | 137 |
| 133 RenderProcessHost* process_; | 138 RenderProcessHost* process_; |
| 134 InputRouterClient* client_; | 139 InputRouterClient* client_; |
| 135 int routing_id_; | 140 int routing_id_; |
| 136 | 141 |
| 137 // (Similar to |mouse_move_pending_|.) True while waiting for SelectRange_ACK. | 142 // (Similar to |mouse_move_pending_|.) True while waiting for SelectRange_ACK. |
| 138 bool select_range_pending_; | 143 bool select_range_pending_; |
| 139 | 144 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // A queue of keyboard events. We can't trust data from the renderer so we | 184 // A queue of keyboard events. We can't trust data from the renderer so we |
| 180 // stuff key events into a queue and pop them out on ACK, feeding our copy | 185 // stuff key events into a queue and pop them out on ACK, feeding our copy |
| 181 // back to whatever unhandled handler instead of the returned version. | 186 // back to whatever unhandled handler instead of the returned version. |
| 182 KeyQueue key_queue_; | 187 KeyQueue key_queue_; |
| 183 | 188 |
| 184 // Keeps track of whether the webpage has any touch event handler. If it does, | 189 // Keeps track of whether the webpage has any touch event handler. If it does, |
| 185 // then touch events are sent to the renderer. Otherwise, the touch events are | 190 // then touch events are sent to the renderer. Otherwise, the touch events are |
| 186 // not sent to the renderer. | 191 // not sent to the renderer. |
| 187 bool has_touch_handler_; | 192 bool has_touch_handler_; |
| 188 | 193 |
| 194 // Whether enabling the optimization that sending no touch move events to |
| 195 // renderer while scrolling. |
| 196 bool enable_no_touch_to_renderer_while_scrolling_; |
| 197 |
| 189 scoped_ptr<TouchEventQueue> touch_event_queue_; | 198 scoped_ptr<TouchEventQueue> touch_event_queue_; |
| 190 scoped_ptr<GestureEventFilter> gesture_event_filter_; | 199 scoped_ptr<GestureEventFilter> gesture_event_filter_; |
| 191 | 200 |
| 192 DISALLOW_COPY_AND_ASSIGN(ImmediateInputRouter); | 201 DISALLOW_COPY_AND_ASSIGN(ImmediateInputRouter); |
| 193 }; | 202 }; |
| 194 | 203 |
| 195 } // namespace content | 204 } // namespace content |
| 196 | 205 |
| 197 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_IMMEDIATE_INPUT_ROUTER_H_ | 206 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_IMMEDIATE_INPUT_ROUTER_H_ |
| OLD | NEW |