Index: ui/events/gestures/gesture_sequence.h |
diff --git a/ui/events/gestures/gesture_sequence.h b/ui/events/gestures/gesture_sequence.h |
index b3255df573caf748a0fd998f9e3ae25ba76f1241..70977d4ab18fef3ddb271a208f270bd258b2a992 100644 |
--- a/ui/events/gestures/gesture_sequence.h |
+++ b/ui/events/gestures/gesture_sequence.h |
@@ -7,6 +7,7 @@ |
#include "base/timer/timer.h" |
#include "ui/events/event_constants.h" |
+#include "ui/events/gestures/gesture_event_queue.h" |
#include "ui/events/gestures/gesture_point.h" |
#include "ui/events/gestures/gesture_recognizer.h" |
#include "ui/gfx/rect.h" |
@@ -34,23 +35,13 @@ enum ScrollType { |
ST_VERTICAL, |
}; |
-// Delegates dispatch of gesture events for which the GestureSequence does not |
-// have enough context to dispatch itself. |
-class EVENTS_EXPORT GestureSequenceDelegate { |
- public: |
- virtual void DispatchPostponedGestureEvent(GestureEvent* event) = 0; |
- |
- protected: |
- virtual ~GestureSequenceDelegate() {} |
-}; |
- |
// A GestureSequence recognizes gestures from touch sequences. |
class EVENTS_EXPORT GestureSequence { |
public: |
// Maximum number of points in a single gesture. |
static const int kMaxGesturePoints = 12; |
- explicit GestureSequence(GestureSequenceDelegate* delegate); |
+ explicit GestureSequence(GestureEventQueueTimerInterface* geq_timers); |
virtual ~GestureSequence(); |
typedef GestureRecognizer::Gestures Gestures; |
@@ -59,17 +50,16 @@ class EVENTS_EXPORT GestureSequence { |
// Returns list of zero or more GestureEvents identified after processing |
// TouchEvent. |
// Caller would be responsible for freeing up Gestures. |
- virtual Gestures* ProcessTouchEventForGesture(const TouchEvent& event, |
- EventResult status); |
+ virtual Gestures* ProcessTouchEventForGesture(const TouchEvent& event); |
const GesturePoint* points() const { return points_; } |
int point_count() const { return point_count_; } |
const gfx::Point& last_touch_location() const { return last_touch_location_; } |
protected: |
- virtual base::OneShotTimer<GestureSequence>* CreateTimer(); |
- base::OneShotTimer<GestureSequence>* GetLongPressTimer(); |
- base::OneShotTimer<GestureSequence>* GetShowPressTimer(); |
+ virtual base::OneShotTimer<GestureEventQueueTimerInterface>* CreateTimer(); |
+ base::OneShotTimer<GestureEventQueueTimerInterface>* GetLongPressTimer(); |
+ base::OneShotTimer<GestureEventQueueTimerInterface>* GetShowPressTimer(); |
private: |
// Recreates the axis-aligned bounding box that contains all the touch-points |
@@ -108,8 +98,10 @@ class EVENTS_EXPORT GestureSequence { |
Gestures* gestures); |
void AppendDoubleClickGestureEvent(const GesturePoint& point, |
Gestures* gestures); |
- void AppendLongPressGestureEvent(); |
- void AppendShowPressGestureEvent(); |
+ void AppendLongPressGestureEvent(const GesturePoint& point, |
+ Gestures* gestures); |
+ void AppendShowPressGestureEvent(const GesturePoint& point, |
+ Gestures* gestures); |
void AppendLongTapGestureEvent(const GesturePoint& point, |
Gestures* gestures); |
@@ -226,8 +218,10 @@ class EVENTS_EXPORT GestureSequence { |
base::TimeDelta second_touch_time_; |
ScrollType scroll_type_; |
- scoped_ptr<base::OneShotTimer<GestureSequence> > long_press_timer_; |
- scoped_ptr<base::OneShotTimer<GestureSequence> > show_press_timer_; |
+ scoped_ptr<base::OneShotTimer<GestureEventQueueTimerInterface> > |
+ long_press_timer_; |
+ scoped_ptr<base::OneShotTimer<GestureEventQueueTimerInterface> > |
+ show_press_timer_; |
GesturePoint points_[kMaxGesturePoints]; |
int point_count_; |
@@ -235,7 +229,7 @@ class EVENTS_EXPORT GestureSequence { |
// Location of the last touch event. |
gfx::Point last_touch_location_; |
- GestureSequenceDelegate* delegate_; |
+ GestureEventQueueTimerInterface* geq_timers_; |
DISALLOW_COPY_AND_ASSIGN(GestureSequence); |
}; |