Chromium Code Reviews| 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 "base/containers/stack_container.h" | 8 #include "base/containers/stack_container.h" |
| 9 #include "ui/events/gesture_detection/gesture_detection_export.h" | 9 #include "ui/events/gesture_detection/gesture_detection_export.h" |
| 10 #include "ui/events/gesture_detection/gesture_event_data.h" | 10 #include "ui/events/gesture_detection/gesture_event_data.h" |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 | 41 |
| 42 void Push(const GestureEventData& gesture); | 42 void Push(const GestureEventData& gesture); |
| 43 | 43 |
| 44 const base::TimeTicks& timestamp() const { return timestamp_; } | 44 const base::TimeTicks& timestamp() const { return timestamp_; } |
| 45 const GestureEventData& gesture(size_t i) const { return gestures_[i]; } | 45 const GestureEventData& gesture(size_t i) const { return gestures_[i]; } |
| 46 size_t gesture_count() const { return gestures_->size(); } | 46 size_t gesture_count() const { return gestures_->size(); } |
| 47 GestureSource gesture_source() const { return gesture_source_; } | 47 GestureSource gesture_source() const { return gesture_source_; } |
| 48 const gfx::PointF& touch_location() const { return touch_location_; } | 48 const gfx::PointF& touch_location() const { return touch_location_; } |
| 49 const gfx::PointF& raw_touch_location() const { return raw_touch_location_; } | 49 const gfx::PointF& raw_touch_location() const { return raw_touch_location_; } |
| 50 | 50 |
| 51 // This packet was generated based on invalid touch events, so we | |
| 52 // should ignore it. | |
| 53 void mark_to_ignore() { marked_to_ignore_ = true; } | |
| 54 // Check if this packet should be ignored. | |
|
jdduke (slow)
2014/11/20 19:49:16
No need for this getter comment.
tdresser
2014/11/21 13:25:22
Done.
| |
| 55 bool marked_to_ignore() { return marked_to_ignore_; } | |
| 56 | |
| 51 private: | 57 private: |
| 52 GestureEventDataPacket(base::TimeTicks timestamp, | 58 GestureEventDataPacket(base::TimeTicks timestamp, |
| 53 GestureSource source, | 59 GestureSource source, |
| 54 const gfx::PointF& touch_location, | 60 const gfx::PointF& touch_location, |
| 55 const gfx::PointF& raw_touch_location); | 61 const gfx::PointF& raw_touch_location); |
| 56 | 62 |
| 57 enum { kTypicalMaxGesturesPerTouch = 5 }; | 63 enum { kTypicalMaxGesturesPerTouch = 5 }; |
| 58 base::TimeTicks timestamp_; | 64 base::TimeTicks timestamp_; |
| 59 base::StackVector<GestureEventData, kTypicalMaxGesturesPerTouch> gestures_; | 65 base::StackVector<GestureEventData, kTypicalMaxGesturesPerTouch> gestures_; |
| 60 gfx::PointF touch_location_; | 66 gfx::PointF touch_location_; |
| 61 gfx::PointF raw_touch_location_; | 67 gfx::PointF raw_touch_location_; |
| 62 GestureSource gesture_source_; | 68 GestureSource gesture_source_; |
| 69 bool marked_to_ignore_; | |
| 63 }; | 70 }; |
| 64 | 71 |
| 65 } // namespace ui | 72 } // namespace ui |
| 66 | 73 |
| 67 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_EVENT_DATA_PACKET_H_ | 74 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_EVENT_DATA_PACKET_H_ |
| OLD | NEW |