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

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

Issue 502993004: Remove abstract Clone and Cancel methods from MotionEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nasty bug fix Created 6 years, 2 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 2277277aa91812ddb57c0767159817f6541fc07a..469b656f890ce60929d5b8187b1aecdd60ae05a4 100644
--- a/ui/events/gesture_detection/motion_event.h
+++ b/ui/events/gesture_detection/motion_event.h
@@ -76,9 +76,7 @@ class GESTURE_DETECTION_EXPORT MotionEvent {
virtual float GetHistoricalY(size_t pointer_index,
size_t historical_index) const;
- virtual scoped_ptr<MotionEvent> Clone() const = 0;
- virtual scoped_ptr<MotionEvent> Cancel() const = 0;
-
+ // Utility accessor methods for convenience.
float GetX() const { return GetX(0); }
float GetY() const { return GetY(0); }
float GetRawX() const { return GetRawX(0); }
@@ -98,12 +96,14 @@ class GESTURE_DETECTION_EXPORT MotionEvent {
// O(N) search of pointers (use sparingly!). Returns -1 if |id| nonexistent.
int FindPointerIndexOfId(int id) const;
-};
-GESTURE_DETECTION_EXPORT bool operator==(const MotionEvent& lhs,
- const MotionEvent& rhs);
-GESTURE_DETECTION_EXPORT bool operator!=(const MotionEvent& lhs,
- const MotionEvent& rhs);
+ // Note that these methods perform shallow copies of the originating events.
+ // They guarantee only that the returned type will reflect the same
+ // data exposed by the MotionEvent interface; no guarantees are made that the
+ // underlying implementation is identical to the source implementation.
+ scoped_ptr<MotionEvent> Clone() const;
+ scoped_ptr<MotionEvent> Cancel() const;
+};
} // namespace ui
« no previous file with comments | « ui/events/gesture_detection/gesture_provider_unittest.cc ('k') | ui/events/gesture_detection/motion_event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698