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

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

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
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>
6
5 #include "base/basictypes.h" 7 #include "base/basictypes.h"
6 #include "base/time/time.h" 8 #include "base/time/time.h"
7 #include "ui/events/gesture_detection/motion_event.h" 9 #include "ui/events/gesture_detection/motion_event.h"
8 #include "ui/gfx/geometry/point_f.h" 10 #include "ui/gfx/geometry/point_f.h"
9 11
10 namespace ui { 12 namespace ui {
11 13
12 struct MockMotionEvent : public MotionEvent { 14 struct MockMotionEvent : public MotionEvent {
13 enum { MAX_POINTERS = 3 }; 15 enum { MAX_POINTERS = 3 };
14 enum { TOUCH_MAJOR = 10 }; 16 enum { TOUCH_MAJOR = 10 };
15 17
16 MockMotionEvent(); 18 MockMotionEvent();
17 explicit MockMotionEvent(Action action); 19 explicit MockMotionEvent(Action action);
18 MockMotionEvent(Action action, base::TimeTicks time, float x, float y); 20 MockMotionEvent(Action action, base::TimeTicks time, float x, float y);
19 MockMotionEvent(Action action, 21 MockMotionEvent(Action action,
20 base::TimeTicks time, 22 base::TimeTicks time,
21 float x0, 23 float x0,
22 float y0, 24 float y0,
23 float x1, 25 float x1,
24 float y1); 26 float y1);
27 MockMotionEvent(Action action,
28 base::TimeTicks time,
29 float x0,
30 float y0,
31 float x1,
32 float y1,
33 float x2,
34 float y2);
35 MockMotionEvent(Action action,
36 base::TimeTicks time,
37 const std::vector<gfx::PointF>& positions);
25 MockMotionEvent(const MockMotionEvent& other); 38 MockMotionEvent(const MockMotionEvent& other);
26 virtual ~MockMotionEvent(); 39 virtual ~MockMotionEvent();
27 40
28 // MotionEvent methods. 41 // MotionEvent methods.
29 virtual Action GetAction() const OVERRIDE; 42 virtual Action GetAction() const OVERRIDE;
30 virtual int GetActionIndex() const OVERRIDE; 43 virtual int GetActionIndex() const OVERRIDE;
31 virtual size_t GetPointerCount() const OVERRIDE; 44 virtual size_t GetPointerCount() const OVERRIDE;
32 virtual int GetId() const OVERRIDE; 45 virtual int GetId() const OVERRIDE;
33 virtual int GetPointerId(size_t pointer_index) const OVERRIDE; 46 virtual int GetPointerId(size_t pointer_index) const OVERRIDE;
34 virtual float GetX(size_t pointer_index) const OVERRIDE; 47 virtual float GetX(size_t pointer_index) const OVERRIDE;
(...skipping 21 matching lines...) Expand all
56 void ReleasePoint(); 69 void ReleasePoint();
57 void CancelPoint(); 70 void CancelPoint();
58 MotionEvent::Action action; 71 MotionEvent::Action action;
59 size_t pointer_count; 72 size_t pointer_count;
60 gfx::PointF points[MAX_POINTERS]; 73 gfx::PointF points[MAX_POINTERS];
61 base::TimeTicks time; 74 base::TimeTicks time;
62 int id; 75 int id;
63 }; 76 };
64 77
65 } // namespace ui 78 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gesture_detection/gesture_provider_unittest.cc ('k') | ui/events/gesture_detection/mock_motion_event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698