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

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

Issue 407313002: Add a MotionEventGeneric implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: ui/events/gesture_detection/motion_event.h
diff --git a/ui/events/gesture_detection/motion_event.h b/ui/events/gesture_detection/motion_event.h
index b69a38f295abaf30ad2220f50a93ea8392066dcf..065f78e533ba77a05bda6730c120a6152ff578ea 100644
--- a/ui/events/gesture_detection/motion_event.h
+++ b/ui/events/gesture_detection/motion_event.h
@@ -57,19 +57,19 @@ class GESTURE_DETECTION_EXPORT MotionEvent {
virtual float GetRawY(size_t pointer_index) const = 0;
virtual float GetTouchMajor(size_t pointer_index) const = 0;
virtual float GetPressure(size_t pointer_index) const = 0;
+ virtual ToolType GetToolType(size_t pointer_index) const = 0;
+ virtual int GetButtonState() const = 0;
virtual base::TimeTicks GetEventTime() const = 0;
- virtual size_t GetHistorySize() const = 0;
- virtual base::TimeTicks GetHistoricalEventTime(
- size_t historical_index) const = 0;
+ // Optional historical data, default implementation provides an empty history.
+ virtual size_t GetHistorySize() const;
+ virtual base::TimeTicks GetHistoricalEventTime(size_t historical_index) const;
virtual float GetHistoricalTouchMajor(size_t pointer_index,
- size_t historical_index) const = 0;
+ size_t historical_index) const;
virtual float GetHistoricalX(size_t pointer_index,
- size_t historical_index) const = 0;
+ size_t historical_index) const;
virtual float GetHistoricalY(size_t pointer_index,
- size_t historical_index) const = 0;
- virtual ToolType GetToolType(size_t pointer_index) const = 0;
- virtual int GetButtonState() const = 0;
+ size_t historical_index) const;
virtual scoped_ptr<MotionEvent> Clone() const = 0;
virtual scoped_ptr<MotionEvent> Cancel() const = 0;
@@ -85,6 +85,11 @@ class GESTURE_DETECTION_EXPORT MotionEvent {
float GetPressure() const { return GetPressure(0); }
};
+GESTURE_DETECTION_EXPORT bool operator==(const MotionEvent& lhs,
+ const MotionEvent& rhs);
+GESTURE_DETECTION_EXPORT bool operator!=(const MotionEvent& lhs,
+ const MotionEvent& rhs);
+
} // namespace ui
#endif // UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_

Powered by Google App Engine
This is Rietveld 408576698