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 28 matching lines...) Expand all Loading... |
39 | 39 |
40 // Return the window which should handle this TouchEvent, in the case where | 40 // Return the window which should handle this TouchEvent, in the case where |
41 // the touch is already associated with a target. | 41 // the touch is already associated with a target. |
42 // Otherwise, returns null. | 42 // Otherwise, returns null. |
43 virtual GestureConsumer* GetTouchLockedTarget(const TouchEvent& event) = 0; | 43 virtual GestureConsumer* GetTouchLockedTarget(const TouchEvent& event) = 0; |
44 | 44 |
45 // Return the window which should handle this GestureEvent. | 45 // Return the window which should handle this GestureEvent. |
46 virtual GestureConsumer* GetTargetForGestureEvent( | 46 virtual GestureConsumer* GetTargetForGestureEvent( |
47 const GestureEvent& event) = 0; | 47 const GestureEvent& event) = 0; |
48 | 48 |
49 // If there is an active touch within | 49 // Returns the target of the nearest active touch with source device of |
50 // GestureConfiguration::max_separation_for_gesture_touches_in_pixels, | 50 // |source_device_id|, within |
51 // of |location|, returns the target of the nearest active touch. | 51 // GestureConfiguration::max_separation_for_gesture_touches_in_pixels of |
52 virtual GestureConsumer* GetTargetForLocation(const gfx::Point& location) = 0; | 52 // |location|, or NULL if no such point exists. |
| 53 virtual GestureConsumer* GetTargetForLocation( |
| 54 const gfx::Point& location, int source_device_id) = 0; |
53 | 55 |
54 // Makes |new_consumer| the target for events previously targeting | 56 // Makes |new_consumer| the target for events previously targeting |
55 // |current_consumer|. All other targets are canceled. | 57 // |current_consumer|. All other targets are canceled. |
56 // The caller is responsible for updating the state of the consumers to | 58 // The caller is responsible for updating the state of the consumers to |
57 // be aware of this transfer of control (there are no ENTERED/EXITED events). | 59 // be aware of this transfer of control (there are no ENTERED/EXITED events). |
58 // If |new_consumer| is NULL, all events are canceled. | 60 // If |new_consumer| is NULL, all events are canceled. |
59 // If |old_consumer| is NULL, all events not already targeting |new_consumer| | 61 // If |old_consumer| is NULL, all events not already targeting |new_consumer| |
60 // are canceled. | 62 // are canceled. |
61 virtual void TransferEventsTo(GestureConsumer* current_consumer, | 63 virtual void TransferEventsTo(GestureConsumer* current_consumer, |
62 GestureConsumer* new_consumer) = 0; | 64 GestureConsumer* new_consumer) = 0; |
(...skipping 15 matching lines...) Expand all Loading... |
78 | 80 |
79 // Unsubscribes |helper| from async gesture dispatch. | 81 // Unsubscribes |helper| from async gesture dispatch. |
80 // Since the GestureRecognizer does not own the |helper|, it is not deleted | 82 // Since the GestureRecognizer does not own the |helper|, it is not deleted |
81 // and must be cleaned up appropriately by the caller. | 83 // and must be cleaned up appropriately by the caller. |
82 virtual void RemoveGestureEventHelper(GestureEventHelper* helper) = 0; | 84 virtual void RemoveGestureEventHelper(GestureEventHelper* helper) = 0; |
83 }; | 85 }; |
84 | 86 |
85 } // namespace ui | 87 } // namespace ui |
86 | 88 |
87 #endif // UI_EVENTS_GESTURES_GESTURE_RECOGNIZER_H_ | 89 #endif // UI_EVENTS_GESTURES_GESTURE_RECOGNIZER_H_ |
OLD | NEW |