| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 // Adds an event to the queue. The event may be coalesced with previously | 43 // Adds an event to the queue. The event may be coalesced with previously |
| 44 // queued events (e.g. consecutive touch-move events can be coalesced into a | 44 // queued events (e.g. consecutive touch-move events can be coalesced into a |
| 45 // single touch-move event). The event may also be immediately forwarded to | 45 // single touch-move event). The event may also be immediately forwarded to |
| 46 // the renderer (e.g. when there are no other queued touch event). | 46 // the renderer (e.g. when there are no other queued touch event). |
| 47 void QueueEvent(const TouchEventWithLatencyInfo& event); | 47 void QueueEvent(const TouchEventWithLatencyInfo& event); |
| 48 | 48 |
| 49 // Notifies the queue that a touch-event has been processed by the renderer. | 49 // Notifies the queue that a touch-event has been processed by the renderer. |
| 50 // At this point, the queue may send one or more gesture events and/or | 50 // At this point, the queue may send one or more gesture events and/or |
| 51 // additional queued touch-events to the renderer. | 51 // additional queued touch-events to the renderer. |
| 52 void ProcessTouchAck(InputEventAckState ack_result); | 52 void ProcessTouchAck(InputEventAckState ack_result, |
| 53 const ui::LatencyInfo& latency_info); |
| 53 | 54 |
| 54 // Empties the queue of touch events. This may result in any number of gesture | 55 // Empties the queue of touch events. This may result in any number of gesture |
| 55 // events being sent to the renderer. | 56 // events being sent to the renderer. |
| 56 void FlushQueue(); | 57 void FlushQueue(); |
| 57 | 58 |
| 58 // Returns whether the event-queue is empty. | 59 // Returns whether the event-queue is empty. |
| 59 bool empty() const WARN_UNUSED_RESULT { | 60 bool empty() const WARN_UNUSED_RESULT { |
| 60 return touch_queue_.empty(); | 61 return touch_queue_.empty(); |
| 61 } | 62 } |
| 62 | 63 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 84 | 85 |
| 85 // Used to defer touch forwarding when ack dispatch triggers |QueueEvent()|. | 86 // Used to defer touch forwarding when ack dispatch triggers |QueueEvent()|. |
| 86 bool dispatching_touch_ack_; | 87 bool dispatching_touch_ack_; |
| 87 | 88 |
| 88 DISALLOW_COPY_AND_ASSIGN(TouchEventQueue); | 89 DISALLOW_COPY_AND_ASSIGN(TouchEventQueue); |
| 89 }; | 90 }; |
| 90 | 91 |
| 91 } // namespace content | 92 } // namespace content |
| 92 | 93 |
| 93 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_ | 94 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_ |
| OLD | NEW |