| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 bool send_touch_events_async_; | 231 bool send_touch_events_async_; |
| 231 bool needs_async_touchmove_for_outer_slop_region_; | 232 bool needs_async_touchmove_for_outer_slop_region_; |
| 232 scoped_ptr<TouchEventWithLatencyInfo> pending_async_touchmove_; | 233 scoped_ptr<TouchEventWithLatencyInfo> pending_async_touchmove_; |
| 233 double last_sent_touch_timestamp_sec_; | 234 double last_sent_touch_timestamp_sec_; |
| 234 | 235 |
| 235 // How touch events are handled during scrolling. For now this is a global | 236 // How touch events are handled during scrolling. For now this is a global |
| 236 // setting for experimentation, but we may evolve it into an app-controlled | 237 // setting for experimentation, but we may evolve it into an app-controlled |
| 237 // mode. | 238 // mode. |
| 238 const TouchScrollingMode touch_scrolling_mode_; | 239 const TouchScrollingMode touch_scrolling_mode_; |
| 239 | 240 |
| 241 // Event is saved to compare pointer positions for new touchmove events. |
| 242 scoped_ptr<blink::WebTouchEvent> last_sent_touchevent_; |
| 243 |
| 240 DISALLOW_COPY_AND_ASSIGN(TouchEventQueue); | 244 DISALLOW_COPY_AND_ASSIGN(TouchEventQueue); |
| 241 }; | 245 }; |
| 242 | 246 |
| 243 } // namespace content | 247 } // namespace content |
| 244 | 248 |
| 245 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_ | 249 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_ |
| OLD | NEW |