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

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

Issue 181833003: [Android] Out with the Android GR, in with the new unified C++ GR (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 10 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
Index: ui/events/gesture_detection/mock_motion_event.h
diff --git a/ui/events/gesture_detection/mock_motion_event.h b/ui/events/gesture_detection/mock_motion_event.h
index 27da9326470f4bfd7aebf83d2567963af3e1da14..d5c7f535d3b27da03a42cfab1166c9f585ef364a 100644
--- a/ui/events/gesture_detection/mock_motion_event.h
+++ b/ui/events/gesture_detection/mock_motion_event.h
@@ -10,6 +10,10 @@
namespace ui {
struct MockMotionEvent : public MotionEvent {
+ enum { MAX_POINTERS = 3 };
+
+ MockMotionEvent();
+ explicit MockMotionEvent(Action action);
MockMotionEvent(Action action, base::TimeTicks time, float x, float y);
MockMotionEvent(Action action,
base::TimeTicks time,
@@ -20,6 +24,7 @@ struct MockMotionEvent : public MotionEvent {
MockMotionEvent(const MockMotionEvent& other);
virtual ~MockMotionEvent();
+ // MotionEvent methods.
virtual Action GetAction() const OVERRIDE;
virtual int GetActionIndex() const OVERRIDE;
virtual size_t GetPointerCount() const OVERRIDE;
@@ -41,13 +46,16 @@ struct MockMotionEvent : public MotionEvent {
virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE;
virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE;
+ // Utility methods.
+ void PressPoint(float x, float y);
+ void MovePoint(size_t index, float x, float y);
+ void ReleasePoint();
+ void CancelPoint();
+
MotionEvent::Action action;
size_t pointer_count;
- gfx::PointF points[2];
+ gfx::PointF points[MAX_POINTERS];
base::TimeTicks time;
-
- private:
- MockMotionEvent();
};
} // namespace ui
« 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