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

Unified Diff: ui/events/gesture_detection/motion_event_generic.cc

Issue 1035793003: Exposes more mutation functions to MotionEventGeneric (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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_generic.cc
diff --git a/ui/events/gesture_detection/motion_event_generic.cc b/ui/events/gesture_detection/motion_event_generic.cc
index 3789ec64657f5c516fd31800bddafd45dc667fac..475e9c5bc808eb3d40f042fd5a8aff751a4858c5 100644
--- a/ui/events/gesture_detection/motion_event_generic.cc
+++ b/ui/events/gesture_detection/motion_event_generic.cc
@@ -197,9 +197,15 @@ scoped_ptr<MotionEventGeneric> MotionEventGeneric::CancelEvent(
return cancel_event.Pass();
}
-void MotionEventGeneric::PushPointer(const PointerProperties& pointer) {
+size_t MotionEventGeneric::PushPointer(const PointerProperties& pointer) {
DCHECK_EQ(0U, GetHistorySize());
pointers_->push_back(pointer);
+ return pointers_->size() - 1;
+}
+
+void MotionEventGeneric::RemovePointerAt(size_t index) {
+ DCHECK_LT(index, pointers_->size());
+ pointers_->erase(pointers_->begin() + index);
}
void MotionEventGeneric::PushHistoricalEvent(scoped_ptr<MotionEvent> event) {
« no previous file with comments | « ui/events/gesture_detection/motion_event_generic.h ('k') | ui/events/gesture_detection/motion_event_generic_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698