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

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

Issue 306483003: Prepare for Unified Gesture Recognizer landing in Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix whitespace, disable UGR. Created 6 years, 7 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_provider_aura.cc ('k') | ui/events/test/events_test_utils_x11.cc » ('j') | 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 c27af4aaafdce5247c72a2ed3b375c43fbf4ddb9..6ec5ccf96f1932ea09af8cada291058428dcb528 100644
--- a/ui/events/gestures/gesture_recognizer_impl.cc
+++ b/ui/events/gestures/gesture_recognizer_impl.cc
@@ -308,7 +308,7 @@ void GestureRecognizerImpl::DispatchGestureEvent(GestureEvent* event) {
}
}
-GestureSequence::Gestures* GestureRecognizerImpl::ProcessTouchEventForGesture(
+ScopedVector<GestureEvent>* GestureRecognizerImpl::ProcessTouchEventForGesture(
const TouchEvent& event,
ui::EventResult result,
GestureConsumer* target) {
@@ -322,8 +322,10 @@ GestureSequence::Gestures* GestureRecognizerImpl::ProcessTouchEventForGesture(
GetGestureProviderForConsumer(target);
// TODO(tdresser) - detect gestures eagerly.
if (!(result & ER_CONSUMED)) {
- if (gesture_provider->OnTouchEvent(event))
+ if (gesture_provider->OnTouchEvent(event)) {
gesture_provider->OnTouchEventAck(result != ER_UNHANDLED);
+ return gesture_provider->GetAndResetPendingGestures();
+ }
}
return NULL;
}
@@ -342,10 +344,7 @@ bool GestureRecognizerImpl::CleanupStateForConsumer(
} else {
if (consumer_gesture_provider_.count(consumer)) {
state_cleaned_up = true;
- // Don't immediately delete the GestureProvider, as we could be in the
- // middle of dispatching a set of gestures.
- base::MessageLoop::current()->DeleteSoon(
- FROM_HERE, consumer_gesture_provider_[consumer]);
+ delete consumer_gesture_provider_[consumer];
consumer_gesture_provider_.erase(consumer);
}
}
« no previous file with comments | « ui/events/gestures/gesture_provider_aura.cc ('k') | ui/events/test/events_test_utils_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698