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

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

Issue 407313002: Add a MotionEventGeneric implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: vesrion Created 6 years, 5 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/gestures/motion_event_aura.cc ('k') | ui/events/test/mock_motion_event.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/test/mock_motion_event.h
diff --git a/ui/events/test/mock_motion_event.h b/ui/events/test/mock_motion_event.h
index f5258102fbccccf6562d1d7e3be87a815b4128f1..9ae9a71980cdf9df6a5be3721b1c005f9007d425 100644
--- a/ui/events/test/mock_motion_event.h
+++ b/ui/events/test/mock_motion_event.h
@@ -6,14 +6,13 @@
#include "base/basictypes.h"
#include "base/time/time.h"
-#include "ui/events/gesture_detection/motion_event.h"
+#include "ui/events/gesture_detection/motion_event_generic.h"
#include "ui/gfx/geometry/point_f.h"
namespace ui {
namespace test {
-struct MockMotionEvent : public MotionEvent {
- enum { MAX_POINTERS = 3 };
+struct MockMotionEvent : public MotionEventGeneric {
enum { TOUCH_MAJOR = 10 };
MockMotionEvent();
@@ -41,36 +40,10 @@ struct MockMotionEvent : public MotionEvent {
virtual ~MockMotionEvent();
// MotionEvent methods.
- virtual Action GetAction() const OVERRIDE;
- virtual int GetActionIndex() const OVERRIDE;
- virtual size_t GetPointerCount() const OVERRIDE;
- virtual int GetId() const OVERRIDE;
- virtual int GetPointerId(size_t pointer_index) const OVERRIDE;
- virtual float GetX(size_t pointer_index) const OVERRIDE;
- virtual float GetY(size_t pointer_index) const OVERRIDE;
- virtual float GetRawX(size_t pointer_index) const OVERRIDE;
- virtual float GetRawY(size_t pointer_index) const OVERRIDE;
- virtual float GetTouchMajor(size_t pointer_index) const OVERRIDE;
- virtual float GetPressure(size_t pointer_index) const OVERRIDE;
- virtual base::TimeTicks GetEventTime() const OVERRIDE;
- virtual size_t GetHistorySize() const OVERRIDE;
- virtual base::TimeTicks GetHistoricalEventTime(size_t historical_index) const
- OVERRIDE;
- virtual float GetHistoricalTouchMajor(size_t pointer_index,
- size_t historical_index) const OVERRIDE;
- virtual float GetHistoricalX(size_t pointer_index,
- size_t historical_index) const OVERRIDE;
- virtual float GetHistoricalY(size_t pointer_index,
- size_t historical_index) const OVERRIDE;
- virtual ToolType GetToolType(size_t pointer_index) const OVERRIDE;
- virtual int GetButtonState() const OVERRIDE;
-
virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE;
virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE;
// Utility methods.
- void SetId(int new_id);
- void SetTime(base::TimeTicks new_time);
void PressPoint(float x, float y);
void MovePoint(size_t index, float x, float y);
void ReleasePoint();
@@ -78,17 +51,10 @@ struct MockMotionEvent : public MotionEvent {
void SetTouchMajor(float new_touch_major);
void SetRawOffset(float raw_offset_x, float raw_offset_y);
void SetToolType(size_t index, ToolType tool_type);
- void SetButtonState(int button_state);
- MotionEvent::Action action;
- size_t pointer_count;
- gfx::PointF points[MAX_POINTERS];
- ToolType tool_types[MAX_POINTERS];
- gfx::Vector2dF raw_offset;
- base::TimeTicks time;
- float touch_major;
- int id;
- int button_state;
+ private:
+ void PushPointer(float x, float y);
+ void ResolvePointers();
};
} // namespace test
« no previous file with comments | « ui/events/gestures/motion_event_aura.cc ('k') | ui/events/test/mock_motion_event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698