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

Unified Diff: ui/events/android/motion_event_android.h

Issue 2896993002: Route OnDragEvent through ViewAndroid tree (Closed)
Patch Set: +ui/base Created 3 years, 7 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/android/drag_event_android.cc ('k') | ui/events/android/motion_event_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/android/motion_event_android.h
diff --git a/ui/events/android/motion_event_android.h b/ui/events/android/motion_event_android.h
index 1411dc4fa730ee32071048aec64b9475bd352c63..a208366a6b5f13688afd18c410950ac8cf62b02a 100644
--- a/ui/events/android/motion_event_android.h
+++ b/ui/events/android/motion_event_android.h
@@ -68,7 +68,12 @@ class EVENTS_EXPORT MotionEventAndroid : public MotionEvent {
const Pointer* const pointer1);
~MotionEventAndroid() override;
- std::unique_ptr<MotionEventAndroid> Offset(float x, float y) const;
+ // Create a new instance from |this| with its cached pointers set
+ // to a given point.
+ std::unique_ptr<MotionEventAndroid> CreateFor(const gfx::PointF& point) const;
+
+ // Convenience method returning the pointer at index 0.
+ gfx::PointF GetPoint() const { return gfx::PointF(GetX(0), GetY(0)); }
// ui::MotionEvent methods.
uint32_t GetUniqueEventId() const override;
@@ -113,9 +118,8 @@ class EVENTS_EXPORT MotionEventAndroid : public MotionEvent {
float ToDips(float pixels) const;
CachedPointer FromAndroidPointer(const Pointer& pointer) const;
- CachedPointer OffsetCachedPointer(const CachedPointer& pointer,
- float x,
- float y) const;
+ CachedPointer CreateCachedPointer(const CachedPointer& pointer,
+ const gfx::PointF& point) const;
// Cache pointer coords, id's and major lengths for the most common
// touch-related scenarios, i.e., scrolling and pinching. This prevents
« no previous file with comments | « ui/events/android/drag_event_android.cc ('k') | ui/events/android/motion_event_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698