OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_GESTURE_EVENT_PACKET_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_GESTURE_EVENT_PACKET_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_GESTURE_EVENT_PACKET_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_GESTURE_EVENT_PACKET_H_ |
7 | 7 |
8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
9 #include "third_party/WebKit/public/web/WebInputEvent.h" | 9 #include "third_party/WebKit/public/web/WebInputEvent.h" |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 static GestureEventPacket FromTouch(const blink::WebTouchEvent& event); | 28 static GestureEventPacket FromTouch(const blink::WebTouchEvent& event); |
29 static GestureEventPacket FromTouchTimeout( | 29 static GestureEventPacket FromTouchTimeout( |
30 const blink::WebGestureEvent& event); | 30 const blink::WebGestureEvent& event); |
31 | 31 |
32 void Push(const blink::WebGestureEvent& gesture); | 32 void Push(const blink::WebGestureEvent& gesture); |
33 | 33 |
34 const blink::WebGestureEvent& gesture(size_t i) const { return gestures_[i]; } | 34 const blink::WebGestureEvent& gesture(size_t i) const { return gestures_[i]; } |
35 size_t gesture_count() const { return gesture_count_; } | 35 size_t gesture_count() const { return gesture_count_; } |
36 GestureSource gesture_source() const { return gesture_source_; } | 36 GestureSource gesture_source() const { return gesture_source_; } |
37 | 37 |
| 38 // Returns true if this packet only contains gestures which are logically |
| 39 // local to the event that generated them. Dropping such a packet won't |
| 40 // affect the semantics of subsequent packets. |
| 41 bool is_independent() const { return is_independent_; } |
| 42 |
38 private: | 43 private: |
39 explicit GestureEventPacket(GestureSource source); | 44 explicit GestureEventPacket(GestureSource source); |
40 | 45 |
41 enum { kMaxGesturesPerTouch = 5 }; | 46 enum { kMaxGesturesPerTouch = 5 }; |
42 blink::WebGestureEvent gestures_[kMaxGesturesPerTouch]; | 47 blink::WebGestureEvent gestures_[kMaxGesturesPerTouch]; |
43 size_t gesture_count_; | 48 size_t gesture_count_; |
44 GestureSource gesture_source_; | 49 GestureSource gesture_source_; |
| 50 bool is_independent_; |
45 }; | 51 }; |
46 | 52 |
47 } // namespace content | 53 } // namespace content |
48 | 54 |
49 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_GESTURE_EVENT_PACKET_H_ | 55 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_GESTURE_EVENT_PACKET_H_ |
OLD | NEW |