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

Unified Diff: ui/events/gesture_detection/mock_motion_event.cc

Issue 212663010: Store the id of a contributing motion event in GestureEventData (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update test. Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/gesture_detection/mock_motion_event.h ('k') | ui/events/gesture_detection/motion_event.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/gesture_detection/mock_motion_event.cc
diff --git a/ui/events/gesture_detection/mock_motion_event.cc b/ui/events/gesture_detection/mock_motion_event.cc
index 7c41d8dbafa26f988e72c889d171aed761070c52..cf293874ba9611acca4c66602aa0dfa1e5be1227 100644
--- a/ui/events/gesture_detection/mock_motion_event.cc
+++ b/ui/events/gesture_detection/mock_motion_event.cc
@@ -14,16 +14,16 @@ const float kTouchMajor = 10.f;
} // namespace
MockMotionEvent::MockMotionEvent()
- : action(ACTION_CANCEL), pointer_count(1) {}
+ : action(ACTION_CANCEL), pointer_count(1), id(0) {}
MockMotionEvent::MockMotionEvent(Action action)
- : action(action), pointer_count(1) {}
+ : action(action), pointer_count(1), id(0) {}
MockMotionEvent::MockMotionEvent(Action action,
TimeTicks time,
float x,
float y)
- : action(action), pointer_count(1), time(time) {
+ : action(action), pointer_count(1), time(time), id(0) {
points[0].SetPoint(x, y);
}
@@ -33,7 +33,7 @@ MockMotionEvent::MockMotionEvent(Action action,
float y0,
float x1,
float y1)
- : action(action), pointer_count(2), time(time) {
+ : action(action), pointer_count(2), time(time), id(0) {
points[0].SetPoint(x0, y0);
points[1].SetPoint(x1, y1);
}
@@ -41,7 +41,8 @@ MockMotionEvent::MockMotionEvent(Action action,
MockMotionEvent::MockMotionEvent(const MockMotionEvent& other)
: action(other.action),
pointer_count(other.pointer_count),
- time(other.time) {
+ time(other.time),
+ id(other.GetId()) {
points[0] = other.points[0];
points[1] = other.points[1];
}
@@ -56,7 +57,16 @@ int MockMotionEvent::GetActionIndex() const {
size_t MockMotionEvent::GetPointerCount() const { return pointer_count; }
+int MockMotionEvent::GetId() const {
+ return id;
+}
+
+void MockMotionEvent::SetId(int new_id) {
+ id = new_id;
+}
+
int MockMotionEvent::GetPointerId(size_t pointer_index) const {
+ DCHECK(pointer_index < pointer_count);
return static_cast<int>(pointer_index);
}
« no previous file with comments | « ui/events/gesture_detection/mock_motion_event.h ('k') | ui/events/gesture_detection/motion_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698