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 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/time/time.h" | 6 #include "base/time/time.h" |
7 #include "ui/events/gesture_detection/motion_event.h" | 7 #include "ui/events/gesture_detection/motion_event.h" |
8 #include "ui/gfx/geometry/point_f.h" | 8 #include "ui/gfx/geometry/point_f.h" |
9 | 9 |
10 namespace ui { | 10 namespace ui { |
(...skipping 10 matching lines...) Expand all Loading... |
21 float y0, | 21 float y0, |
22 float x1, | 22 float x1, |
23 float y1); | 23 float y1); |
24 MockMotionEvent(const MockMotionEvent& other); | 24 MockMotionEvent(const MockMotionEvent& other); |
25 virtual ~MockMotionEvent(); | 25 virtual ~MockMotionEvent(); |
26 | 26 |
27 // MotionEvent methods. | 27 // MotionEvent methods. |
28 virtual Action GetAction() const OVERRIDE; | 28 virtual Action GetAction() const OVERRIDE; |
29 virtual int GetActionIndex() const OVERRIDE; | 29 virtual int GetActionIndex() const OVERRIDE; |
30 virtual size_t GetPointerCount() const OVERRIDE; | 30 virtual size_t GetPointerCount() const OVERRIDE; |
| 31 virtual int GetId() const OVERRIDE; |
31 virtual int GetPointerId(size_t pointer_index) const OVERRIDE; | 32 virtual int GetPointerId(size_t pointer_index) const OVERRIDE; |
32 virtual float GetX(size_t pointer_index) const OVERRIDE; | 33 virtual float GetX(size_t pointer_index) const OVERRIDE; |
33 virtual float GetY(size_t pointer_index) const OVERRIDE; | 34 virtual float GetY(size_t pointer_index) const OVERRIDE; |
34 virtual float GetTouchMajor(size_t pointer_index) const OVERRIDE; | 35 virtual float GetTouchMajor(size_t pointer_index) const OVERRIDE; |
35 virtual float GetPressure(size_t pointer_index) const OVERRIDE; | 36 virtual float GetPressure(size_t pointer_index) const OVERRIDE; |
36 virtual base::TimeTicks GetEventTime() const OVERRIDE; | 37 virtual base::TimeTicks GetEventTime() const OVERRIDE; |
37 virtual size_t GetHistorySize() const OVERRIDE; | 38 virtual size_t GetHistorySize() const OVERRIDE; |
38 virtual base::TimeTicks GetHistoricalEventTime(size_t historical_index) const | 39 virtual base::TimeTicks GetHistoricalEventTime(size_t historical_index) const |
39 OVERRIDE; | 40 OVERRIDE; |
40 virtual float GetHistoricalTouchMajor(size_t pointer_index, | 41 virtual float GetHistoricalTouchMajor(size_t pointer_index, |
41 size_t historical_index) const OVERRIDE; | 42 size_t historical_index) const OVERRIDE; |
42 virtual float GetHistoricalX(size_t pointer_index, | 43 virtual float GetHistoricalX(size_t pointer_index, |
43 size_t historical_index) const OVERRIDE; | 44 size_t historical_index) const OVERRIDE; |
44 virtual float GetHistoricalY(size_t pointer_index, | 45 virtual float GetHistoricalY(size_t pointer_index, |
45 size_t historical_index) const OVERRIDE; | 46 size_t historical_index) const OVERRIDE; |
46 | 47 |
47 virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE; | 48 virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE; |
48 virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE; | 49 virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE; |
49 | 50 |
50 // Utility methods. | 51 // Utility methods. |
| 52 void SetId(int new_id); |
51 void PressPoint(float x, float y); | 53 void PressPoint(float x, float y); |
52 void MovePoint(size_t index, float x, float y); | 54 void MovePoint(size_t index, float x, float y); |
53 void ReleasePoint(); | 55 void ReleasePoint(); |
54 void CancelPoint(); | 56 void CancelPoint(); |
55 | 57 |
56 MotionEvent::Action action; | 58 MotionEvent::Action action; |
57 size_t pointer_count; | 59 size_t pointer_count; |
58 gfx::PointF points[MAX_POINTERS]; | 60 gfx::PointF points[MAX_POINTERS]; |
59 base::TimeTicks time; | 61 base::TimeTicks time; |
| 62 int id; |
60 }; | 63 }; |
61 | 64 |
62 } // namespace ui | 65 } // namespace ui |
OLD | NEW |