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_BASE_GESTURES_GESTURE_RECOGNIZER_IMPL_H_ | 5 #ifndef UI_BASE_GESTURES_GESTURE_RECOGNIZER_IMPL_H_ |
6 #define UI_BASE_GESTURES_GESTURE_RECOGNIZER_IMPL_H_ | 6 #define UI_BASE_GESTURES_GESTURE_RECOGNIZER_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <vector> | 10 #include <vector> |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 ui::TouchStatus status, | 52 ui::TouchStatus status, |
53 GestureConsumer* target) OVERRIDE; | 53 GestureConsumer* target) OVERRIDE; |
54 virtual void QueueTouchEventForGesture(GestureConsumer* consumer, | 54 virtual void QueueTouchEventForGesture(GestureConsumer* consumer, |
55 const TouchEvent& event) OVERRIDE; | 55 const TouchEvent& event) OVERRIDE; |
56 virtual Gestures* AdvanceTouchQueue(GestureConsumer* consumer, | 56 virtual Gestures* AdvanceTouchQueue(GestureConsumer* consumer, |
57 bool processed) OVERRIDE; | 57 bool processed) OVERRIDE; |
58 virtual void FlushTouchQueue(GestureConsumer* consumer) OVERRIDE; | 58 virtual void FlushTouchQueue(GestureConsumer* consumer) OVERRIDE; |
59 | 59 |
60 typedef std::queue<TouchEvent*> TouchEventQueue; | 60 typedef std::queue<TouchEvent*> TouchEventQueue; |
61 std::map<GestureConsumer*, TouchEventQueue*> event_queue_; | 61 std::map<GestureConsumer*, TouchEventQueue*> event_queue_; |
62 std::map<GestureConsumer*, GestureSequence*> consumer_sequence_; | 62 std::map<GestureConsumer*, scoped_ptr<GestureSequence>> consumer_sequence_; |
girard
2012/08/02 17:14:20
Changed to scoped_ptr. This ensures that during
| |
63 | 63 |
64 // Both |touch_id_target_| and |touch_id_target_for_gestures_| map a touch-id | 64 // Both |touch_id_target_| and |touch_id_target_for_gestures_| map a touch-id |
65 // to its target window. touch-ids are removed from |touch_id_target_| on | 65 // to its target window. touch-ids are removed from |touch_id_target_| on |
66 // ET_TOUCH_RELEASE and ET_TOUCH_CANCEL. |touch_id_target_for_gestures_| are | 66 // ET_TOUCH_RELEASE and ET_TOUCH_CANCEL. |touch_id_target_for_gestures_| are |
67 // removed in FlushTouchQueue(). | 67 // removed in FlushTouchQueue(). |
68 TouchIdToConsumerMap touch_id_target_; | 68 TouchIdToConsumerMap touch_id_target_; |
69 TouchIdToConsumerMap touch_id_target_for_gestures_; | 69 TouchIdToConsumerMap touch_id_target_for_gestures_; |
70 | 70 |
71 // Touches cancelled by touch capture are routed to the | 71 // Touches cancelled by touch capture are routed to the |
72 // gesture_consumer_ignorer_. | 72 // gesture_consumer_ignorer_. |
73 scoped_ptr<GestureConsumer> gesture_consumer_ignorer_; | 73 scoped_ptr<GestureConsumer> gesture_consumer_ignorer_; |
74 GestureEventHelper* helper_; | 74 GestureEventHelper* helper_; |
75 | 75 |
76 DISALLOW_COPY_AND_ASSIGN(GestureRecognizerImpl); | 76 DISALLOW_COPY_AND_ASSIGN(GestureRecognizerImpl); |
77 }; | 77 }; |
78 | 78 |
79 } // namespace ui | 79 } // namespace ui |
80 | 80 |
81 #endif // UI_BASE_GESTURES_GESTURE_RECOGNIZER_IMPL_H_ | 81 #endif // UI_BASE_GESTURES_GESTURE_RECOGNIZER_IMPL_H_ |
OLD | NEW |