| 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 "ui/events/gesture_detection/gesture_detection_export.h" | 8 #include "ui/events/gesture_detection/gesture_detection_export.h" |
| 9 #include "ui/events/gesture_detection/gesture_event_data.h" | 9 #include "ui/events/gesture_detection/gesture_event_data.h" |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 static GestureEventDataPacket FromTouch(const ui::MotionEvent& touch); | 37 static GestureEventDataPacket FromTouch(const ui::MotionEvent& touch); |
| 38 static GestureEventDataPacket FromTouchTimeout( | 38 static GestureEventDataPacket FromTouchTimeout( |
| 39 const GestureEventData& gesture); | 39 const GestureEventData& gesture); |
| 40 | 40 |
| 41 void Push(const GestureEventData& gesture); | 41 void Push(const GestureEventData& gesture); |
| 42 | 42 |
| 43 const base::TimeTicks& timestamp() const { return timestamp_; } | 43 const base::TimeTicks& timestamp() const { return timestamp_; } |
| 44 const GestureEventData& gesture(size_t i) const { return gestures_[i]; } | 44 const GestureEventData& gesture(size_t i) const { return gestures_[i]; } |
| 45 size_t gesture_count() const { return gesture_count_; } | 45 size_t gesture_count() const { return gesture_count_; } |
| 46 GestureSource gesture_source() const { return gesture_source_; } | 46 GestureSource gesture_source() const { return gesture_source_; } |
| 47 gfx::PointF touch_location() const { return touch_location_; } |
| 47 | 48 |
| 48 private: | 49 private: |
| 49 GestureEventDataPacket(base::TimeTicks timestamp, GestureSource source); | 50 GestureEventDataPacket(base::TimeTicks timestamp, |
| 51 GestureSource source, |
| 52 gfx::PointF touch_location); |
| 50 | 53 |
| 51 enum { kMaxGesturesPerTouch = 5 }; | 54 enum { kMaxGesturesPerTouch = 5 }; |
| 52 base::TimeTicks timestamp_; | 55 base::TimeTicks timestamp_; |
| 53 GestureEventData gestures_[kMaxGesturesPerTouch]; | 56 GestureEventData gestures_[kMaxGesturesPerTouch]; |
| 54 size_t gesture_count_; | 57 size_t gesture_count_; |
| 58 gfx::PointF touch_location_; |
| 55 GestureSource gesture_source_; | 59 GestureSource gesture_source_; |
| 56 }; | 60 }; |
| 57 | 61 |
| 58 } // namespace ui | 62 } // namespace ui |
| 59 | 63 |
| 60 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_EVENT_DATA_PACKET_H_ | 64 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_EVENT_DATA_PACKET_H_ |
| OLD | NEW |