| 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 18 matching lines...) Expand all Loading... |
| 29 const TouchEventWithLatencyInfo& event) = 0; | 29 const TouchEventWithLatencyInfo& event) = 0; |
| 30 | 30 |
| 31 virtual void OnTouchEventAck( | 31 virtual void OnTouchEventAck( |
| 32 const TouchEventWithLatencyInfo& event, | 32 const TouchEventWithLatencyInfo& event, |
| 33 InputEventAckState ack_result) = 0; | 33 InputEventAckState ack_result) = 0; |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 // A queue for throttling and coalescing touch-events. | 36 // A queue for throttling and coalescing touch-events. |
| 37 class CONTENT_EXPORT TouchEventQueue { | 37 class CONTENT_EXPORT TouchEventQueue { |
| 38 public: | 38 public: |
| 39 | |
| 40 // The |client| must outlive the TouchEventQueue. | 39 // The |client| must outlive the TouchEventQueue. |
| 41 explicit TouchEventQueue(TouchEventQueueClient* client); | 40 explicit TouchEventQueue(TouchEventQueueClient* client); |
| 42 ~TouchEventQueue(); | 41 ~TouchEventQueue(); |
| 43 | 42 |
| 44 // 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 |
| 45 // 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 |
| 46 // 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 |
| 47 // 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). |
| 48 void QueueEvent(const TouchEventWithLatencyInfo& event); | 47 void QueueEvent(const TouchEventWithLatencyInfo& event); |
| 49 | 48 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 // Optional suppression of TouchMove's within a slop region when a sequence | 163 // Optional suppression of TouchMove's within a slop region when a sequence |
| 165 // has not yet been preventDefaulted, disabled by default. | 164 // has not yet been preventDefaulted, disabled by default. |
| 166 scoped_ptr<TouchMoveSlopSuppressor> touchmove_slop_suppressor_; | 165 scoped_ptr<TouchMoveSlopSuppressor> touchmove_slop_suppressor_; |
| 167 | 166 |
| 168 DISALLOW_COPY_AND_ASSIGN(TouchEventQueue); | 167 DISALLOW_COPY_AND_ASSIGN(TouchEventQueue); |
| 169 }; | 168 }; |
| 170 | 169 |
| 171 } // namespace content | 170 } // namespace content |
| 172 | 171 |
| 173 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_ | 172 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_ |
| OLD | NEW |