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

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: Test three finger swipe 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 16
15 MockMotionEvent(); 17 MockMotionEvent();
16 explicit MockMotionEvent(Action action); 18 explicit MockMotionEvent(Action action);
17 MockMotionEvent(Action action, base::TimeTicks time, float x, float y); 19 MockMotionEvent(Action action, base::TimeTicks time, float x, float y);
18 MockMotionEvent(Action action, 20 MockMotionEvent(Action action,
19 base::TimeTicks time, 21 base::TimeTicks time,
20 float x0, 22 float x0,
21 float y0, 23 float y0,
22 float x1, 24 float x1,
23 float y1); 25 float y1);
26 MockMotionEvent(Action action,
27 base::TimeTicks time,
28 float x0,
29 float y0,
30 float x1,
31 float y1,
32 float x2,
33 float y2);
34 MockMotionEvent(Action action,
35 base::TimeTicks time,
36 const std::vector<gfx::PointF>& positions);
24 MockMotionEvent(const MockMotionEvent& other); 37 MockMotionEvent(const MockMotionEvent& other);
25 virtual ~MockMotionEvent(); 38 virtual ~MockMotionEvent();
26 39
27 // MotionEvent methods. 40 // MotionEvent methods.
28 virtual Action GetAction() const OVERRIDE; 41 virtual Action GetAction() const OVERRIDE;
29 virtual int GetActionIndex() const OVERRIDE; 42 virtual int GetActionIndex() const OVERRIDE;
30 virtual size_t GetPointerCount() const OVERRIDE; 43 virtual size_t GetPointerCount() const OVERRIDE;
31 virtual int GetId() const OVERRIDE; 44 virtual int GetId() const OVERRIDE;
32 virtual int GetPointerId(size_t pointer_index) const OVERRIDE; 45 virtual int GetPointerId(size_t pointer_index) const OVERRIDE;
33 virtual float GetX(size_t pointer_index) const OVERRIDE; 46 virtual float GetX(size_t pointer_index) const OVERRIDE;
(...skipping 22 matching lines...) Expand all
56 void CancelPoint(); 69 void CancelPoint();
57 70
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

Powered by Google App Engine
This is Rietveld 408576698