Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(429)

Side by Side Diff: ui/events/gesture_detection/mock_motion_event.h

Issue 348813002: Extend MotionEvent to have tool type and button state (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 virtual base::TimeTicks GetEventTime() const OVERRIDE; 53 virtual base::TimeTicks GetEventTime() const OVERRIDE;
54 virtual size_t GetHistorySize() const OVERRIDE; 54 virtual size_t GetHistorySize() const OVERRIDE;
55 virtual base::TimeTicks GetHistoricalEventTime(size_t historical_index) const 55 virtual base::TimeTicks GetHistoricalEventTime(size_t historical_index) const
56 OVERRIDE; 56 OVERRIDE;
57 virtual float GetHistoricalTouchMajor(size_t pointer_index, 57 virtual float GetHistoricalTouchMajor(size_t pointer_index,
58 size_t historical_index) const OVERRIDE; 58 size_t historical_index) const OVERRIDE;
59 virtual float GetHistoricalX(size_t pointer_index, 59 virtual float GetHistoricalX(size_t pointer_index,
60 size_t historical_index) const OVERRIDE; 60 size_t historical_index) const OVERRIDE;
61 virtual float GetHistoricalY(size_t pointer_index, 61 virtual float GetHistoricalY(size_t pointer_index,
62 size_t historical_index) const OVERRIDE; 62 size_t historical_index) const OVERRIDE;
63 virtual ToolType GetToolType(size_t pointer_index) const OVERRIDE;
64 virtual int GetButtonState() const OVERRIDE;
63 65
64 virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE; 66 virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE;
65 virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE; 67 virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE;
66 68
67 // Utility methods. 69 // Utility methods.
68 void SetId(int new_id); 70 void SetId(int new_id);
69 void SetTime(base::TimeTicks new_time); 71 void SetTime(base::TimeTicks new_time);
70 void PressPoint(float x, float y); 72 void PressPoint(float x, float y);
71 void MovePoint(size_t index, float x, float y); 73 void MovePoint(size_t index, float x, float y);
72 void ReleasePoint(); 74 void ReleasePoint();
73 void CancelPoint(); 75 void CancelPoint();
74 void SetTouchMajor(float new_touch_major); 76 void SetTouchMajor(float new_touch_major);
75 void SetRawOffset(float raw_offset_x, float raw_offset_y); 77 void SetRawOffset(float raw_offset_x, float raw_offset_y);
76 78
77 MotionEvent::Action action; 79 MotionEvent::Action action;
78 size_t pointer_count; 80 size_t pointer_count;
79 gfx::PointF points[MAX_POINTERS]; 81 gfx::PointF points[MAX_POINTERS];
80 gfx::Vector2dF raw_offset; 82 gfx::Vector2dF raw_offset;
81 base::TimeTicks time; 83 base::TimeTicks time;
82 float touch_major; 84 float touch_major;
83 int id; 85 int id;
84 }; 86 };
85 87
86 } // namespace ui 88 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698