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

Side by Side Diff: ui/events/gestures/gesture_recognizer_impl.h

Issue 2789203006: Routes touch ACK events to the correct GestureProvider (Closed)
Patch Set: nits Created 3 years, 8 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
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_EVENTS_GESTURES_GESTURE_RECOGNIZER_IMPL_H_ 5 #ifndef UI_EVENTS_GESTURES_GESTURE_RECOGNIZER_IMPL_H_
6 #define UI_EVENTS_GESTURES_GESTURE_RECOGNIZER_IMPL_H_ 6 #define UI_EVENTS_GESTURES_GESTURE_RECOGNIZER_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // Overridden from GestureProviderAuraClient 81 // Overridden from GestureProviderAuraClient
82 void OnGestureEvent(GestureConsumer* raw_input_consumer, 82 void OnGestureEvent(GestureConsumer* raw_input_consumer,
83 GestureEvent* event) override; 83 GestureEvent* event) override;
84 84
85 // Convenience method to find the GestureEventHelper that can dispatch events 85 // Convenience method to find the GestureEventHelper that can dispatch events
86 // to a specific |consumer|. 86 // to a specific |consumer|.
87 GestureEventHelper* FindDispatchHelperForConsumer(GestureConsumer* consumer); 87 GestureEventHelper* FindDispatchHelperForConsumer(GestureConsumer* consumer);
88 std::map<GestureConsumer*, std::unique_ptr<GestureProviderAura>> 88 std::map<GestureConsumer*, std::unique_ptr<GestureProviderAura>>
89 consumer_gesture_provider_; 89 consumer_gesture_provider_;
90 90
91 // Maps an event via its |unique_event_id| to the corresponding gesture
92 // provider. This avoids any invalid reference while routing ACKs for events
93 // that may arise post |TransferEventsTo()| function call.
94 // See http://crbug.com/698843 for more info.
95 std::map<uint32_t, GestureProviderAura*> event_to_gesture_provider_;
96
91 // |touch_id_target_| maps a touch-id to its target window. 97 // |touch_id_target_| maps a touch-id to its target window.
92 // touch-ids are removed from |touch_id_target_| on 98 // touch-ids are removed from |touch_id_target_| on
93 // ET_TOUCH_RELEASE and ET_TOUCH_CANCEL. 99 // ET_TOUCH_RELEASE and ET_TOUCH_CANCEL.
94 TouchIdToConsumerMap touch_id_target_; 100 TouchIdToConsumerMap touch_id_target_;
95 101
96 std::vector<GestureEventHelper*> helpers_; 102 std::vector<GestureEventHelper*> helpers_;
97 103
98 DISALLOW_COPY_AND_ASSIGN(GestureRecognizerImpl); 104 DISALLOW_COPY_AND_ASSIGN(GestureRecognizerImpl);
99 }; 105 };
100 106
101 // Provided only for testing: 107 // Provided only for testing:
102 EVENTS_EXPORT void SetGestureRecognizerForTesting( 108 EVENTS_EXPORT void SetGestureRecognizerForTesting(
103 GestureRecognizer* gesture_recognizer); 109 GestureRecognizer* gesture_recognizer);
104 110
105 } // namespace ui 111 } // namespace ui
106 112
107 #endif // UI_EVENTS_GESTURES_GESTURE_RECOGNIZER_IMPL_H_ 113 #endif // UI_EVENTS_GESTURES_GESTURE_RECOGNIZER_IMPL_H_
OLDNEW
« no previous file with comments | « ui/aura/gestures/gesture_recognizer_unittest.cc ('k') | ui/events/gestures/gesture_recognizer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698