diff options
Diffstat (limited to 'ui/base/gestures/gesture_sequence.h')
-rw-r--r-- | ui/base/gestures/gesture_sequence.h | 47 |
1 files changed, 18 insertions, 29 deletions
diff --git a/ui/base/gestures/gesture_sequence.h b/ui/base/gestures/gesture_sequence.h index b8a9a02..e8d7aab 100644 --- a/ui/base/gestures/gesture_sequence.h +++ b/ui/base/gestures/gesture_sequence.h @@ -10,7 +10,6 @@ #include "ui/base/events.h" #include "ui/base/gestures/gesture_point.h" #include "ui/base/gestures/gesture_recognizer.h" -#include "ui/gfx/rect.h" namespace ui { class TouchEvent; @@ -22,6 +21,7 @@ enum GestureState { GS_PENDING_SYNTHETIC_CLICK, GS_SCROLL, GS_PINCH, + GS_THREE_FINGER_SWIPE }; enum ScrollType { @@ -59,12 +59,6 @@ class UI_EXPORT GestureSequence { private: void Reset(); - // Recreates the axis-aligned bounding box that contains all the touch-points - // at their most recent position. - void RecreateBoundingBox(); - - void ResetVelocities(); - GesturePoint& GesturePointForEvent(const TouchEvent& event); // Do a linear scan through points_ to find the GesturePoint @@ -75,7 +69,6 @@ class UI_EXPORT GestureSequence { // Tap gestures. void AppendTapDownGestureEvent(const GesturePoint& point, Gestures* gestures); - void AppendTapUpGestureEvent(const GesturePoint& point, Gestures* gestures); void AppendClickGestureEvent(const GesturePoint& point, Gestures* gestures); void AppendDoubleClickGestureEvent(const GesturePoint& point, Gestures* gestures); @@ -102,13 +95,17 @@ class UI_EXPORT GestureSequence { const GesturePoint& p2, float scale, Gestures* gestures); - void AppendPinchGestureUpdate(const GesturePoint& point, + void AppendPinchGestureUpdate(const GesturePoint& p1, + const GesturePoint& p2, float scale, Gestures* gestures); - void AppendSwipeGesture(const GesturePoint& point, - int swipe_x, - int swipe_y, - Gestures* gestures); + + void AppendThreeFingerSwipeGestureEvent(const GesturePoint& p1, + const GesturePoint& p2, + const GesturePoint& p3, + float x_velocity, + float y_velocity, + Gestures* gestures); void set_state(const GestureState state ) { state_ = state; } @@ -119,11 +116,11 @@ class UI_EXPORT GestureSequence { const GesturePoint& point, Gestures* gestures); bool ScrollStart(const TouchEvent& event, - GesturePoint& point, - Gestures* gestures); + GesturePoint& point, + Gestures* gestures); void BreakRailScroll(const TouchEvent& event, - GesturePoint& point, - Gestures* gestures); + GesturePoint& point, + Gestures* gestures); bool ScrollUpdate(const TouchEvent& event, const GesturePoint& point, Gestures* gestures); @@ -145,9 +142,9 @@ class UI_EXPORT GestureSequence { bool PinchEnd(const TouchEvent& event, const GesturePoint& point, Gestures* gestures); - bool MaybeSwipe(const TouchEvent& event, - const GesturePoint& point, - Gestures* gestures); + bool ThreeFingerSwipeUpdate(const TouchEvent& event, + const GesturePoint& point, + Gestures* gestures); // Current state of gesture recognizer. GestureState state_; @@ -155,15 +152,6 @@ class UI_EXPORT GestureSequence { // ui::EventFlags. int flags_; - // We maintain the smallest axis-aligned rectangle that contains all the - // current touch-points. The 'distance' represents the diagonal distance. - // This box is updated after every touch-event. - gfx::Rect bounding_box_; - gfx::Point bounding_box_last_center_; - - // For pinch, the 'distance' represents the diagonal distance of - // |bounding_box_|. - // The distance between the two points at PINCH_START. float pinch_distance_start_; @@ -171,6 +159,7 @@ class UI_EXPORT GestureSequence { float pinch_distance_current_; ScrollType scroll_type_; + bool three_finger_swipe_has_fired_; scoped_ptr<base::OneShotTimer<GestureSequence> > long_press_timer_; GesturePoint points_[kMaxGesturePoints]; |