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

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

Issue 243403002: Add multi-finger swipe detection to GestureDetector (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix M_PI Created 6 years, 8 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
« no previous file with comments | « ui/events/gesture_detection/mock_motion_event.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/events/gesture_detection/mock_motion_event.h" 5 #include "ui/events/gesture_detection/mock_motion_event.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 using base::TimeTicks; 9 using base::TimeTicks;
10 10
(...skipping 17 matching lines...) Expand all
28 TimeTicks time, 28 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 : action(action), pointer_count(2), time(time), id(0) { 33 : action(action), pointer_count(2), time(time), id(0) {
34 points[0].SetPoint(x0, y0); 34 points[0].SetPoint(x0, y0);
35 points[1].SetPoint(x1, y1); 35 points[1].SetPoint(x1, y1);
36 } 36 }
37 37
38 MockMotionEvent::MockMotionEvent(Action action,
39 TimeTicks time,
40 float x0,
41 float y0,
42 float x1,
43 float y1,
44 float x2,
45 float y2)
46 : action(action), pointer_count(3), time(time), id(0) {
47 points[0].SetPoint(x0, y0);
48 points[1].SetPoint(x1, y1);
49 points[2].SetPoint(x2, y2);
50 }
51
38 MockMotionEvent::MockMotionEvent(const MockMotionEvent& other) 52 MockMotionEvent::MockMotionEvent(const MockMotionEvent& other)
39 : action(other.action), 53 : action(other.action),
40 pointer_count(other.pointer_count), 54 pointer_count(other.pointer_count),
41 time(other.time), 55 time(other.time),
42 id(other.GetId()) { 56 id(other.GetId()) {
43 points[0] = other.points[0]; 57 points[0] = other.points[0];
44 points[1] = other.points[1]; 58 points[1] = other.points[1];
45 } 59 }
46 60
47 MockMotionEvent::~MockMotionEvent() {} 61 MockMotionEvent::~MockMotionEvent() {}
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 } 159 }
146 160
147 void MockMotionEvent::CancelPoint() { 161 void MockMotionEvent::CancelPoint() {
148 DCHECK_GT(pointer_count, 0U); 162 DCHECK_GT(pointer_count, 0U);
149 if (pointer_count > 1) 163 if (pointer_count > 1)
150 --pointer_count; 164 --pointer_count;
151 action = ACTION_CANCEL; 165 action = ACTION_CANCEL;
152 } 166 }
153 167
154 } // namespace ui 168 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gesture_detection/mock_motion_event.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698