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

Unified Diff: ui/base/gestures/gesture_point.h

Issue 11415293: Refactor access to scroll deltas in GesturePoint (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments Created 8 years 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/aura/gestures/gesture_recognizer_unittest.cc ('k') | ui/base/gestures/gesture_point.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/gestures/gesture_point.h
diff --git a/ui/base/gestures/gesture_point.h b/ui/base/gestures/gesture_point.h
index 54946813cff53329e5fb7b4d7633915afc86bff6..0e77fd2a877b86c264dc3977ac88a86fa5e408fb 100644
--- a/ui/base/gestures/gesture_point.h
+++ b/ui/base/gestures/gesture_point.h
@@ -72,13 +72,7 @@ class GesturePoint {
bool in_use() const { return point_id_ >= 0; }
- double x_delta() const {
- return last_touch_position_.x() - first_touch_position_.x();
- }
-
- double y_delta() const {
- return last_touch_position_.y() - first_touch_position_.y();
- }
+ gfx::Vector2d ScrollDelta();
float XVelocity() { return velocity_calculator_.XVelocity(); }
float YVelocity() { return velocity_calculator_.YVelocity(); }
@@ -101,11 +95,13 @@ class GesturePoint {
void UpdateEnclosingRectangle(const TouchEvent& event);
void clear_enclosing_rectangle() { enclosing_rect_ = gfx::Rect(); }
- // The position of touchdown event, or of the last scroll gesture event.
- // We may want to consider tracking these two things in separate variables.
+ // The position of the first touchdown event.
gfx::Point first_touch_position_;
double first_touch_time_;
+ gfx::Point second_last_touch_position_;
+ double second_last_touch_time_;
+
gfx::Point last_touch_position_;
double last_touch_time_;
« no previous file with comments | « ui/aura/gestures/gesture_recognizer_unittest.cc ('k') | ui/base/gestures/gesture_point.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698