OLD | NEW |
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_EVENTS_GESTURES_GESTURE_RECOGNIZER_H_ | 5 #ifndef UI_EVENTS_GESTURES_GESTURE_RECOGNIZER_H_ |
6 #define UI_EVENTS_GESTURES_GESTURE_RECOGNIZER_H_ | 6 #define UI_EVENTS_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 17 matching lines...) Expand all Loading... |
28 virtual ~GestureRecognizer() {} | 28 virtual ~GestureRecognizer() {} |
29 | 29 |
30 // Invoked for each touch event that could contribute to the current gesture. | 30 // Invoked for each touch event that could contribute to the current gesture. |
31 // Returns list of zero or more GestureEvents identified after processing | 31 // Returns list of zero or more GestureEvents identified after processing |
32 // TouchEvent. | 32 // TouchEvent. |
33 // Caller would be responsible for freeing up Gestures. | 33 // Caller would be responsible for freeing up Gestures. |
34 virtual Gestures* ProcessTouchEventForGesture(const TouchEvent& event, | 34 virtual Gestures* ProcessTouchEventForGesture(const TouchEvent& event, |
35 ui::EventResult result, | 35 ui::EventResult result, |
36 GestureConsumer* consumer) = 0; | 36 GestureConsumer* consumer) = 0; |
37 | 37 |
| 38 // Sends an ack to the gesture detector, and returns any gestures triggered by |
| 39 // the ack. |
| 40 virtual ScopedVector<GestureEvent>* AckTouchEventForGesture( |
| 41 ui::EventResult result, |
| 42 GestureConsumer* target) = 0; |
| 43 |
38 // This is called when the consumer is destroyed. So this should cleanup any | 44 // This is called when the consumer is destroyed. So this should cleanup any |
39 // internal state maintained for |consumer|. Returns true iff there was | 45 // internal state maintained for |consumer|. Returns true iff there was |
40 // state relating to |consumer| to clean up. | 46 // state relating to |consumer| to clean up. |
41 virtual bool CleanupStateForConsumer(GestureConsumer* consumer) = 0; | 47 virtual bool CleanupStateForConsumer(GestureConsumer* consumer) = 0; |
42 | 48 |
43 // Return the window which should handle this TouchEvent, in the case where | 49 // Return the window which should handle this TouchEvent, in the case where |
44 // the touch is already associated with a target. | 50 // the touch is already associated with a target. |
45 // Otherwise, returns null. | 51 // Otherwise, returns null. |
46 virtual GestureConsumer* GetTouchLockedTarget(const TouchEvent& event) = 0; | 52 virtual GestureConsumer* GetTouchLockedTarget(const TouchEvent& event) = 0; |
47 | 53 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 90 |
85 // Unsubscribes |helper| from async gesture dispatch. | 91 // Unsubscribes |helper| from async gesture dispatch. |
86 // Since the GestureRecognizer does not own the |helper|, it is not deleted | 92 // Since the GestureRecognizer does not own the |helper|, it is not deleted |
87 // and must be cleaned up appropriately by the caller. | 93 // and must be cleaned up appropriately by the caller. |
88 virtual void RemoveGestureEventHelper(GestureEventHelper* helper) = 0; | 94 virtual void RemoveGestureEventHelper(GestureEventHelper* helper) = 0; |
89 }; | 95 }; |
90 | 96 |
91 } // namespace ui | 97 } // namespace ui |
92 | 98 |
93 #endif // UI_EVENTS_GESTURES_GESTURE_RECOGNIZER_H_ | 99 #endif // UI_EVENTS_GESTURES_GESTURE_RECOGNIZER_H_ |
OLD | NEW |