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

Side by Side Diff: ui/base/gestures/gesture_recognizer.h

Issue 11188012: gesture recognizer: Remove the touch-event queue. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/events/event_constants.cc ('k') | ui/base/gestures/gesture_recognizer_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_BASE_GESTURES_GESTURE_RECOGNIZER_H_ 5 #ifndef UI_BASE_GESTURES_GESTURE_RECOGNIZER_H_
6 #define UI_BASE_GESTURES_GESTURE_RECOGNIZER_H_ 6 #define UI_BASE_GESTURES_GESTURE_RECOGNIZER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 14 matching lines...) Expand all
25 virtual ~GestureRecognizer() {} 25 virtual ~GestureRecognizer() {}
26 26
27 // Invoked for each touch event that could contribute to the current gesture. 27 // Invoked for each touch event that could contribute to the current gesture.
28 // Returns list of zero or more GestureEvents identified after processing 28 // Returns list of zero or more GestureEvents identified after processing
29 // TouchEvent. 29 // TouchEvent.
30 // Caller would be responsible for freeing up Gestures. 30 // Caller would be responsible for freeing up Gestures.
31 virtual Gestures* ProcessTouchEventForGesture(const TouchEvent& event, 31 virtual Gestures* ProcessTouchEventForGesture(const TouchEvent& event,
32 ui::EventResult result, 32 ui::EventResult result,
33 GestureConsumer* consumer) = 0; 33 GestureConsumer* consumer) = 0;
34 34
35 // Touch-events can be queued to be played back at a later time. The queues 35 // This is called when the consumer is destroyed. So this should cleanup any
36 // are identified by the target window. 36 // internal state maintained for |consumer|.
37 virtual void QueueTouchEventForGesture(GestureConsumer* consumer, 37 virtual void CleanupStateForConsumer(GestureConsumer* consumer) = 0;
38 const TouchEvent& event) = 0;
39
40 // Process the touch-event in the queue for the window. Returns a list of
41 // zero or more GestureEvents identified after processing the queueud
42 // TouchEvent. Caller is responsible for freeing up Gestures.
43 virtual Gestures* AdvanceTouchQueue(GestureConsumer* consumer,
44 bool processed) = 0;
45
46 // Flushes the touch event queue (or removes the queue) for the window.
47 virtual void FlushTouchQueue(GestureConsumer* consumer) = 0;
48 38
49 // Return the window which should handle this TouchEvent, in the case where 39 // Return the window which should handle this TouchEvent, in the case where
50 // the touch is already associated with a target. 40 // the touch is already associated with a target.
51 // Otherwise, returns null. 41 // Otherwise, returns null.
52 virtual GestureConsumer* GetTouchLockedTarget(TouchEvent* event) = 0; 42 virtual GestureConsumer* GetTouchLockedTarget(TouchEvent* event) = 0;
53 43
54 // Return the window which should handle this GestureEvent. 44 // Return the window which should handle this GestureEvent.
55 virtual GestureConsumer* GetTargetForGestureEvent(GestureEvent* event) = 0; 45 virtual GestureConsumer* GetTargetForGestureEvent(GestureEvent* event) = 0;
56 46
57 // If there is an active touch within 47 // If there is an active touch within
(...skipping 10 matching lines...) Expand all
68 // If a gesture is underway for |consumer| |point| is set to the last touch 58 // If a gesture is underway for |consumer| |point| is set to the last touch
69 // point and true is returned. If no touch events have been processed for 59 // point and true is returned. If no touch events have been processed for
70 // |consumer| false is returned and |point| is untouched. 60 // |consumer| false is returned and |point| is untouched.
71 virtual bool GetLastTouchPointForTarget(GestureConsumer* consumer, 61 virtual bool GetLastTouchPointForTarget(GestureConsumer* consumer,
72 gfx::Point* point) = 0; 62 gfx::Point* point) = 0;
73 }; 63 };
74 64
75 } // namespace ui 65 } // namespace ui
76 66
77 #endif // UI_BASE_GESTURES_GESTURE_RECOGNIZER_H_ 67 #endif // UI_BASE_GESTURES_GESTURE_RECOGNIZER_H_
OLDNEW
« no previous file with comments | « ui/base/events/event_constants.cc ('k') | ui/base/gestures/gesture_recognizer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698