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 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/time/time.h" |
12 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
13 #include "content/port/browser/event_with_latency_info.h" | 14 #include "content/port/browser/event_with_latency_info.h" |
14 #include "content/port/common/input_event_ack_state.h" | 15 #include "content/port/common/input_event_ack_state.h" |
15 #include "third_party/WebKit/public/web/WebInputEvent.h" | 16 #include "third_party/WebKit/public/web/WebInputEvent.h" |
16 #include "ui/gfx/geometry/point_f.h" | 17 #include "ui/gfx/geometry/point_f.h" |
17 | 18 |
18 namespace content { | 19 namespace content { |
19 | 20 |
20 class CoalescedWebTouchEvent; | 21 class CoalescedWebTouchEvent; |
21 | 22 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 InputEventAckState ack_result); | 87 InputEventAckState ack_result); |
87 | 88 |
88 // Notifies the queue whether the renderer has at least one touch handler. | 89 // Notifies the queue whether the renderer has at least one touch handler. |
89 void OnHasTouchEventHandlers(bool has_handlers); | 90 void OnHasTouchEventHandlers(bool has_handlers); |
90 | 91 |
91 // Returns whether the currently pending touch event (waiting ACK) is for | 92 // Returns whether the currently pending touch event (waiting ACK) is for |
92 // a touch start event. | 93 // a touch start event. |
93 bool IsPendingAckTouchStart() const; | 94 bool IsPendingAckTouchStart() const; |
94 | 95 |
95 // Sets whether a delayed touch ack will cancel and flush the current | 96 // Sets whether a delayed touch ack will cancel and flush the current |
96 // touch sequence. | 97 // touch sequence. Note that, if the timeout was previously disabled, enabling |
97 void SetAckTimeoutEnabled(bool enabled, size_t ack_timeout_delay_ms); | 98 // it will take effect only for the following touch sequence. |
| 99 void SetAckTimeoutEnabled(bool enabled, base::TimeDelta ack_timeout_delay); |
98 | 100 |
99 bool empty() const WARN_UNUSED_RESULT { | 101 bool empty() const WARN_UNUSED_RESULT { |
100 return touch_queue_.empty(); | 102 return touch_queue_.empty(); |
101 } | 103 } |
102 | 104 |
103 size_t size() const { | 105 size_t size() const { |
104 return touch_queue_.size(); | 106 return touch_queue_.size(); |
105 } | 107 } |
106 | 108 |
107 bool ack_timeout_enabled() const { | 109 bool ack_timeout_enabled() const { |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 // setting for experimentation, but we may evolve it into an app-controlled | 199 // setting for experimentation, but we may evolve it into an app-controlled |
198 // mode. | 200 // mode. |
199 const TouchScrollingMode touch_scrolling_mode_; | 201 const TouchScrollingMode touch_scrolling_mode_; |
200 | 202 |
201 DISALLOW_COPY_AND_ASSIGN(TouchEventQueue); | 203 DISALLOW_COPY_AND_ASSIGN(TouchEventQueue); |
202 }; | 204 }; |
203 | 205 |
204 } // namespace content | 206 } // namespace content |
205 | 207 |
206 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_ | 208 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_TOUCH_EVENT_QUEUE_H_ |
OLD | NEW |