| 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_TOUCH_EVENT_QUEUE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 157 |
| 158 // Ack all coalesced events in |acked_event| to the client with |ack_result|, | 158 // Ack all coalesced events in |acked_event| to the client with |ack_result|, |
| 159 // updating the acked events with |optional_latency_info| if it exists. | 159 // updating the acked events with |optional_latency_info| if it exists. |
| 160 void AckTouchEventToClient(InputEventAckState ack_result, | 160 void AckTouchEventToClient(InputEventAckState ack_result, |
| 161 scoped_ptr<CoalescedWebTouchEvent> acked_event, | 161 scoped_ptr<CoalescedWebTouchEvent> acked_event, |
| 162 const ui::LatencyInfo* optional_latency_info); | 162 const ui::LatencyInfo* optional_latency_info); |
| 163 | 163 |
| 164 // Safely pop the head of the queue. | 164 // Safely pop the head of the queue. |
| 165 scoped_ptr<CoalescedWebTouchEvent> PopTouchEvent(); | 165 scoped_ptr<CoalescedWebTouchEvent> PopTouchEvent(); |
| 166 | 166 |
| 167 // Dispatch |touch| to the client. | 167 // Dispatch |touch| to the client. Before dispatching, updates pointer |
| 168 void SendTouchEventImmediately(const TouchEventWithLatencyInfo& touch); | 168 // states in touchmove events for pointers that have not changed position. |
| 169 void SendTouchEventImmediately(TouchEventWithLatencyInfo* touch); |
| 169 | 170 |
| 170 enum PreFilterResult { | 171 enum PreFilterResult { |
| 171 ACK_WITH_NO_CONSUMER_EXISTS, | 172 ACK_WITH_NO_CONSUMER_EXISTS, |
| 172 ACK_WITH_NOT_CONSUMED, | 173 ACK_WITH_NOT_CONSUMED, |
| 173 FORWARD_TO_RENDERER, | 174 FORWARD_TO_RENDERER, |
| 174 }; | 175 }; |
| 175 // Filter touches prior to forwarding to the renderer, e.g., if the renderer | 176 // Filter touches prior to forwarding to the renderer, e.g., if the renderer |
| 176 // has no touch handler. | 177 // has no touch handler. |
| 177 PreFilterResult FilterBeforeForwarding(const blink::WebTouchEvent& event); | 178 PreFilterResult FilterBeforeForwarding(const blink::WebTouchEvent& event); |
| 178 void ForwardToRenderer(const TouchEventWithLatencyInfo& event); | 179 void ForwardToRenderer(const TouchEventWithLatencyInfo& event); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 // For details see the design doc at http://goo.gl/lVyJAa. | 230 // For details see the design doc at http://goo.gl/lVyJAa. |
| 230 bool send_touch_events_async_; | 231 bool send_touch_events_async_; |
| 231 scoped_ptr<TouchEventWithLatencyInfo> pending_async_touchmove_; | 232 scoped_ptr<TouchEventWithLatencyInfo> pending_async_touchmove_; |
| 232 double last_sent_touch_timestamp_sec_; | 233 double last_sent_touch_timestamp_sec_; |
| 233 | 234 |
| 234 // How touch events are handled during scrolling. For now this is a global | 235 // How touch events are handled during scrolling. For now this is a global |
| 235 // setting for experimentation, but we may evolve it into an app-controlled | 236 // setting for experimentation, but we may evolve it into an app-controlled |
| 236 // mode. | 237 // mode. |
| 237 const TouchScrollingMode touch_scrolling_mode_; | 238 const TouchScrollingMode touch_scrolling_mode_; |
| 238 | 239 |
| 240 // Event is saved to compare pointer positions for new touchmove events. |
| 241 scoped_ptr<blink::WebTouchEvent> last_sent_touchevent_; |
| 242 |
| 239 DISALLOW_COPY_AND_ASSIGN(TouchEventQueue); | 243 DISALLOW_COPY_AND_ASSIGN(TouchEventQueue); |
| 240 }; | 244 }; |
| 241 | 245 |
| 242 } // namespace content | 246 } // namespace content |
| 243 | 247 |
| 244 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_ | 248 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_ |
| OLD | NEW |