| 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 14 matching lines...) Expand all Loading... |
| 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 GetPointerId(size_t pointer_index) const OVERRIDE; | 31 virtual int GetPointerId(size_t pointer_index) const OVERRIDE; |
| 32 virtual float GetX(size_t pointer_index) const OVERRIDE; | 32 virtual float GetX(size_t pointer_index) const OVERRIDE; |
| 33 virtual float GetY(size_t pointer_index) const OVERRIDE; | 33 virtual float GetY(size_t pointer_index) const OVERRIDE; |
| 34 virtual float GetTouchMajor(size_t pointer_index) const OVERRIDE; | 34 virtual float GetTouchMajor(size_t pointer_index) const OVERRIDE; |
| 35 virtual float GetPressure(size_t pointer_index) const OVERRIDE; |
| 35 virtual base::TimeTicks GetEventTime() const OVERRIDE; | 36 virtual base::TimeTicks GetEventTime() const OVERRIDE; |
| 36 virtual size_t GetHistorySize() const OVERRIDE; | 37 virtual size_t GetHistorySize() const OVERRIDE; |
| 37 virtual base::TimeTicks GetHistoricalEventTime(size_t historical_index) const | 38 virtual base::TimeTicks GetHistoricalEventTime(size_t historical_index) const |
| 38 OVERRIDE; | 39 OVERRIDE; |
| 39 virtual float GetHistoricalTouchMajor(size_t pointer_index, | 40 virtual float GetHistoricalTouchMajor(size_t pointer_index, |
| 40 size_t historical_index) const OVERRIDE; | 41 size_t historical_index) const OVERRIDE; |
| 41 virtual float GetHistoricalX(size_t pointer_index, | 42 virtual float GetHistoricalX(size_t pointer_index, |
| 42 size_t historical_index) const OVERRIDE; | 43 size_t historical_index) const OVERRIDE; |
| 43 virtual float GetHistoricalY(size_t pointer_index, | 44 virtual float GetHistoricalY(size_t pointer_index, |
| 44 size_t historical_index) const OVERRIDE; | 45 size_t historical_index) const OVERRIDE; |
| 45 | 46 |
| 46 virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE; | 47 virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE; |
| 47 virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE; | 48 virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE; |
| 48 | 49 |
| 49 // Utility methods. | 50 // Utility methods. |
| 50 void PressPoint(float x, float y); | 51 void PressPoint(float x, float y); |
| 51 void MovePoint(size_t index, float x, float y); | 52 void MovePoint(size_t index, float x, float y); |
| 52 void ReleasePoint(); | 53 void ReleasePoint(); |
| 53 void CancelPoint(); | 54 void CancelPoint(); |
| 54 | 55 |
| 55 MotionEvent::Action action; | 56 MotionEvent::Action action; |
| 56 size_t pointer_count; | 57 size_t pointer_count; |
| 57 gfx::PointF points[MAX_POINTERS]; | 58 gfx::PointF points[MAX_POINTERS]; |
| 58 base::TimeTicks time; | 59 base::TimeTicks time; |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 } // namespace ui | 62 } // namespace ui |
| OLD | NEW |