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 UI_EVENTS_GESTURE_DETECTION_GESTURE_EVENT_DATA_PACKET_H_ | 5 #ifndef UI_EVENTS_GESTURE_DETECTION_GESTURE_EVENT_DATA_PACKET_H_ |
6 #define UI_EVENTS_GESTURE_DETECTION_GESTURE_EVENT_DATA_PACKET_H_ | 6 #define UI_EVENTS_GESTURE_DETECTION_GESTURE_EVENT_DATA_PACKET_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 const base::TimeTicks& timestamp() const { return timestamp_; } | 55 const base::TimeTicks& timestamp() const { return timestamp_; } |
56 const GestureEventData& gesture(size_t i) const { return gestures_[i]; } | 56 const GestureEventData& gesture(size_t i) const { return gestures_[i]; } |
57 size_t gesture_count() const { return gestures_->size(); } | 57 size_t gesture_count() const { return gestures_->size(); } |
58 GestureSource gesture_source() const { return gesture_source_; } | 58 GestureSource gesture_source() const { return gesture_source_; } |
59 const gfx::PointF& touch_location() const { return touch_location_; } | 59 const gfx::PointF& touch_location() const { return touch_location_; } |
60 const gfx::PointF& raw_touch_location() const { return raw_touch_location_; } | 60 const gfx::PointF& raw_touch_location() const { return raw_touch_location_; } |
61 | 61 |
62 // We store the ack with the packet until the packet reaches the | 62 // We store the ack with the packet until the packet reaches the |
63 // head of the queue, and then we handle the ack. | 63 // head of the queue, and then we handle the ack. |
64 void Ack(bool event_consumed); | 64 void Ack(bool event_consumed, bool is_source_touch_event_set_non_blocking); |
65 AckState ack_state() { return ack_state_; } | 65 AckState ack_state() { return ack_state_; } |
66 uint32_t unique_touch_event_id() const { return unique_touch_event_id_; } | 66 uint32_t unique_touch_event_id() const { return unique_touch_event_id_; } |
67 | 67 |
68 private: | 68 private: |
69 GestureEventDataPacket(base::TimeTicks timestamp, | 69 GestureEventDataPacket(base::TimeTicks timestamp, |
70 GestureSource source, | 70 GestureSource source, |
71 const gfx::PointF& touch_location, | 71 const gfx::PointF& touch_location, |
72 const gfx::PointF& raw_touch_location, | 72 const gfx::PointF& raw_touch_location, |
73 uint32_t unique_touch_event_id); | 73 uint32_t unique_touch_event_id); |
74 | 74 |
75 enum { kTypicalMaxGesturesPerTouch = 5 }; | 75 enum { kTypicalMaxGesturesPerTouch = 5 }; |
76 base::TimeTicks timestamp_; | 76 base::TimeTicks timestamp_; |
77 base::StackVector<GestureEventData, kTypicalMaxGesturesPerTouch> gestures_; | 77 base::StackVector<GestureEventData, kTypicalMaxGesturesPerTouch> gestures_; |
78 gfx::PointF touch_location_; | 78 gfx::PointF touch_location_; |
79 gfx::PointF raw_touch_location_; | 79 gfx::PointF raw_touch_location_; |
80 GestureSource gesture_source_; | 80 GestureSource gesture_source_; |
81 AckState ack_state_; | 81 AckState ack_state_; |
82 uint32_t unique_touch_event_id_; | 82 uint32_t unique_touch_event_id_; |
83 }; | 83 }; |
84 | 84 |
85 } // namespace ui | 85 } // namespace ui |
86 | 86 |
87 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_EVENT_DATA_PACKET_H_ | 87 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_EVENT_DATA_PACKET_H_ |
OLD | NEW |