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 #include <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "ui/events/gesture_detection/motion_event.h" | 9 #include "ui/events/gesture_detection/motion_event.h" |
| 10 #include "ui/gfx/geometry/point_f.h" | 10 #include "ui/gfx/geometry/point_f.h" |
| 11 | 11 |
| 12 namespace ui { | 12 namespace ui { |
| 13 | 13 |
| 14 struct MockMotionEvent : public MotionEvent { | 14 struct MockMotionEvent : public MotionEvent { |
| 15 enum { MAX_POINTERS = 3 }; | 15 enum { MAX_POINTERS = 4 }; |
| 16 enum { TOUCH_MAJOR = 10 }; | 16 enum { TOUCH_MAJOR = 10 }; |
| 17 | 17 |
| 18 MockMotionEvent(); | 18 MockMotionEvent(); |
| 19 explicit MockMotionEvent(Action action); | 19 explicit MockMotionEvent(Action action); |
| 20 MockMotionEvent(Action action, base::TimeTicks time, float x, float y); | 20 MockMotionEvent(Action action, base::TimeTicks time, float x, float y); |
| 21 MockMotionEvent(Action action, | 21 MockMotionEvent(Action action, |
| 22 base::TimeTicks time, | 22 base::TimeTicks time, |
| 23 float x0, | 23 float x0, |
| 24 float y0, | 24 float y0, |
| 25 float x1, | 25 float x1, |
| 26 float y1); | 26 float y1); |
| 27 MockMotionEvent(Action action, | 27 MockMotionEvent(Action action, |
| 28 base::TimeTicks time, | 28 base::TimeTicks time, |
| 29 float x0, | 29 float x0, |
| 30 float y0, | 30 float y0, |
| 31 float x1, | 31 float x1, |
| 32 float y1, | 32 float y1, |
| 33 float x2, | 33 float x2, |
| 34 float y2); | 34 float y2); |
| 35 MockMotionEvent(Action action, | 35 MockMotionEvent(Action action, |
| 36 base::TimeTicks time, | 36 base::TimeTicks time, |
| 37 float x0, | |
|
jdduke (slow)
2014/05/28 16:26:00
See note from gesture_provider_unittest.cc, I'm no
tdresser
2014/05/29 14:26:21
Removed...
| |
| 38 float y0, | |
| 39 float x1, | |
| 40 float y1, | |
| 41 float x2, | |
| 42 float y2, | |
| 43 float x3, | |
| 44 float y3); | |
| 45 MockMotionEvent(Action action, | |
| 46 base::TimeTicks time, | |
| 37 const std::vector<gfx::PointF>& positions); | 47 const std::vector<gfx::PointF>& positions); |
| 38 MockMotionEvent(const MockMotionEvent& other); | 48 MockMotionEvent(const MockMotionEvent& other); |
| 39 virtual ~MockMotionEvent(); | 49 virtual ~MockMotionEvent(); |
| 40 | 50 |
| 41 // MotionEvent methods. | 51 // MotionEvent methods. |
| 42 virtual Action GetAction() const OVERRIDE; | 52 virtual Action GetAction() const OVERRIDE; |
| 43 virtual int GetActionIndex() const OVERRIDE; | 53 virtual int GetActionIndex() const OVERRIDE; |
| 44 virtual size_t GetPointerCount() const OVERRIDE; | 54 virtual size_t GetPointerCount() const OVERRIDE; |
| 45 virtual int GetId() const OVERRIDE; | 55 virtual int GetId() const OVERRIDE; |
| 46 virtual int GetPointerId(size_t pointer_index) const OVERRIDE; | 56 virtual int GetPointerId(size_t pointer_index) const OVERRIDE; |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 70 void ReleasePoint(); | 80 void ReleasePoint(); |
| 71 void CancelPoint(); | 81 void CancelPoint(); |
| 72 MotionEvent::Action action; | 82 MotionEvent::Action action; |
| 73 size_t pointer_count; | 83 size_t pointer_count; |
| 74 gfx::PointF points[MAX_POINTERS]; | 84 gfx::PointF points[MAX_POINTERS]; |
| 75 base::TimeTicks time; | 85 base::TimeTicks time; |
| 76 int id; | 86 int id; |
| 77 }; | 87 }; |
| 78 | 88 |
| 79 } // namespace ui | 89 } // namespace ui |
| OLD | NEW |