| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // Called by ProcessInputEventAck() to process a gesture event ack message. | 119 // Called by ProcessInputEventAck() to process a gesture event ack message. |
| 118 // This validates the gesture for suppression of touchpad taps and sends one | 120 // This validates the gesture for suppression of touchpad taps and sends one |
| 119 // previously queued coalesced gesture if it exists. | 121 // previously queued coalesced gesture if it exists. |
| 120 void ProcessGestureAck(int type, InputEventAckState ack_result); | 122 void ProcessGestureAck(int type, InputEventAckState ack_result); |
| 121 | 123 |
| 122 // Called on ProcessInputEventAck() to process a touch event ack message. | 124 // Called on ProcessInputEventAck() to process a touch event ack message. |
| 123 // This can result in a gesture event being generated and sent back to the | 125 // This can result in a gesture event being generated and sent back to the |
| 124 // renderer. | 126 // renderer. |
| 125 void ProcessTouchAck(InputEventAckState ack_result); | 127 void ProcessTouchAck(InputEventAckState ack_result); |
| 126 | 128 |
| 129 void HandleGestureScroll( |
| 130 const GestureEventWithLatencyInfo& gesture_event); |
| 131 |
| 127 int routing_id() const { return routing_id_; } | 132 int routing_id() const { return routing_id_; } |
| 128 | 133 |
| 129 | 134 |
| 130 RenderProcessHost* process_; | 135 RenderProcessHost* process_; |
| 131 InputRouterClient* client_; | 136 InputRouterClient* client_; |
| 132 int routing_id_; | 137 int routing_id_; |
| 133 | 138 |
| 134 // (Similar to |mouse_move_pending_|.) True while waiting for SelectRange_ACK. | 139 // (Similar to |mouse_move_pending_|.) True while waiting for SelectRange_ACK. |
| 135 bool select_range_pending_; | 140 bool select_range_pending_; |
| 136 | 141 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 // A queue of keyboard events. We can't trust data from the renderer so we | 181 // A queue of keyboard events. We can't trust data from the renderer so we |
| 177 // stuff key events into a queue and pop them out on ACK, feeding our copy | 182 // stuff key events into a queue and pop them out on ACK, feeding our copy |
| 178 // back to whatever unhandled handler instead of the returned version. | 183 // back to whatever unhandled handler instead of the returned version. |
| 179 KeyQueue key_queue_; | 184 KeyQueue key_queue_; |
| 180 | 185 |
| 181 // Keeps track of whether the webpage has any touch event handler. If it does, | 186 // Keeps track of whether the webpage has any touch event handler. If it does, |
| 182 // then touch events are sent to the renderer. Otherwise, the touch events are | 187 // then touch events are sent to the renderer. Otherwise, the touch events are |
| 183 // not sent to the renderer. | 188 // not sent to the renderer. |
| 184 bool has_touch_handler_; | 189 bool has_touch_handler_; |
| 185 | 190 |
| 191 // Whether enabling the optimization that sending no touch move events to |
| 192 // renderer while scrolling. |
| 193 bool enable_no_touch_to_renderer_while_scrolling_; |
| 194 |
| 186 scoped_ptr<TouchEventQueue> touch_event_queue_; | 195 scoped_ptr<TouchEventQueue> touch_event_queue_; |
| 187 scoped_ptr<GestureEventFilter> gesture_event_filter_; | 196 scoped_ptr<GestureEventFilter> gesture_event_filter_; |
| 188 | 197 |
| 189 DISALLOW_COPY_AND_ASSIGN(ImmediateInputRouter); | 198 DISALLOW_COPY_AND_ASSIGN(ImmediateInputRouter); |
| 190 }; | 199 }; |
| 191 | 200 |
| 192 } // namespace content | 201 } // namespace content |
| 193 | 202 |
| 194 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_IMMEDIATE_INPUT_ROUTER_H_ | 203 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_IMMEDIATE_INPUT_ROUTER_H_ |
| OLD | NEW |