diff options
Diffstat (limited to 'ui/aura/gestures/gesture_point.h')
-rw-r--r-- | ui/aura/gestures/gesture_point.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/ui/aura/gestures/gesture_point.h b/ui/aura/gestures/gesture_point.h index 4269865..f4b589d 100644 --- a/ui/aura/gestures/gesture_point.h +++ b/ui/aura/gestures/gesture_point.h @@ -7,7 +7,6 @@ #pragma once #include "base/basictypes.h" -#include "ui/aura/gestures/velocity_calculator.h" #include "ui/gfx/point.h" namespace aura { @@ -26,7 +25,7 @@ enum GestureState { class GesturePoint { public: GesturePoint(); - ~GesturePoint(); + virtual ~GesturePoint() {} // Resets various states. void Reset(); @@ -46,7 +45,7 @@ class GesturePoint { bool IsInClickWindow(const TouchEvent& event) const; bool IsInDoubleClickWindow(const TouchEvent& event) const; bool IsInScrollWindow(const TouchEvent& event) const; - bool IsInFlickWindow(const TouchEvent& event); + bool IsInFlickWindow(const TouchEvent& event) const; bool DidScroll(const TouchEvent& event, int distance) const; const gfx::Point& first_touch_position() const { @@ -64,8 +63,8 @@ class GesturePoint { return last_touch_position_.y() - first_touch_position_.y(); } - float XVelocity() { return velocity_calculator_.XVelocity(); } - float YVelocity() { return velocity_calculator_.YVelocity(); } + float x_velocity() const { return x_velocity_; } + float y_velocity() const { return y_velocity_; } float Distance(const GesturePoint& point) const; @@ -75,7 +74,7 @@ class GesturePoint { bool IsInSecondClickTimeWindow() const; bool IsInsideManhattanSquare(const TouchEvent& event) const; bool IsSecondClickInsideManhattanSquare(const TouchEvent& event) const; - bool IsOverMinFlickSpeed(); + bool IsOverMinFlickSpeed() const; gfx::Point first_touch_position_; double first_touch_time_; @@ -85,7 +84,9 @@ class GesturePoint { double last_tap_time_; gfx::Point last_tap_position_; - VelocityCalculator velocity_calculator_; + float x_velocity_; + float y_velocity_; + DISALLOW_COPY_AND_ASSIGN(GesturePoint); }; |