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

Unified Diff: ui/events/gestures/gesture_recognizer_impl.cc

Issue 2789203006: Routes touch ACK events to the correct GestureProvider (Closed)
Patch Set: Fixed Tests 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/gestures/gesture_recognizer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/gestures/gesture_recognizer_impl.cc
diff --git a/ui/events/gestures/gesture_recognizer_impl.cc b/ui/events/gestures/gesture_recognizer_impl.cc
index 9be2e4188f841b3a7f8407e8c50000356a807eaa..0dbce96a0598e85d00095477f754daa02b1fd640 100644
--- a/ui/events/gestures/gesture_recognizer_impl.cc
+++ b/ui/events/gestures/gesture_recognizer_impl.cc
@@ -271,6 +271,7 @@ bool GestureRecognizerImpl::ProcessTouchEventPreDispatch(
GestureProviderAura* gesture_provider =
GetGestureProviderForConsumer(consumer);
+ event_to_gesture_provider_[event->unique_event_id()] = gesture_provider;
return gesture_provider->OnTouchEvent(event);
}
@@ -278,8 +279,16 @@ GestureRecognizer::Gestures GestureRecognizerImpl::AckTouchEvent(
uint32_t unique_event_id,
ui::EventResult result,
GestureConsumer* consumer) {
- GestureProviderAura* gesture_provider =
- GetGestureProviderForConsumer(consumer);
+ GestureProviderAura* gesture_provider = nullptr;
+
+ // Check if we have already processed this event before dispatch and have a
+ // consumer associted with it.
tdresser 2017/04/05 14:23:39 associted -> associated
malaykeshav 2017/04/06 20:50:32 Done
+ if (event_to_gesture_provider_.count(unique_event_id)) {
+ gesture_provider = event_to_gesture_provider_[unique_event_id];
+ event_to_gesture_provider_.erase(unique_event_id);
+ } else {
+ gesture_provider = GetGestureProviderForConsumer(consumer);
+ }
gesture_provider->OnTouchEventAck(unique_event_id, result != ER_UNHANDLED);
return gesture_provider->GetAndResetPendingGestures();
}
« no previous file with comments | « ui/events/gestures/gesture_recognizer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698