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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 680413006: Re-enable Eager Gesture Recognition on Aura (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix out of order ack problem. Created 6 years, 1 month 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
Index: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 9d6b2e2e662ce5287583e907cba01822f41e097e..3bf29e7ddae0b8bfbc3ef9a627f2609fd18480c8 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -2037,23 +2037,32 @@ void RenderWidgetHostViewAura::OnTouchEvent(ui::TouchEvent* event) {
return;
// Update the touch event first.
- blink::WebTouchPoint* point = UpdateWebTouchEventFromUIEvent(*event,
- &touch_event_);
-
- // Forward the touch event only if a touch point was updated, and there's a
- // touch-event handler in the page, and no other touch-event is in the queue.
- // It is important to always consume the event if there is a touch-event
- // handler in the page, or some touch-event is already in the queue, even if
- // no point has been updated, to make sure that this event does not get
- // processed by the gesture recognizer before the events in the queue.
- if (host_->ShouldForwardTouchEvent())
- event->StopPropagation();
+ blink::WebTouchPoint* point =
+ UpdateWebTouchEventFromUIEvent(*event, &touch_event_);
- if (point) {
- if (host_->ShouldForwardTouchEvent())
- host_->ForwardTouchEventWithLatencyInfo(touch_event_, *event->latency());
- UpdateWebTouchEventAfterDispatch(&touch_event_, point);
+ if (!point && host_->ShouldForwardTouchEvent()) {
+ event->DisableSynchronousHandling();
+ // Ignore the most recent touch event, as it wasn't valid.
+ DCHECK(window_->GetHost());
+ window_->GetHost()->dispatcher()->IgnoreLastTouchEvent(window_);
jdduke (slow) 2014/11/20 19:49:16 Is this better than calling |ui::GestureRecognizer
tdresser 2014/11/21 13:25:21 Done. I was thinking it was better from a layerin
}
+
+ if (!point)
+ return;
+
+ // Forward the touch event only if a touch point was updated, and
+ // there's a touch-event handler in the page, and no other
+ // touch-event is in the queue. It is important to always mark
+ // events as being handled asynchronously if there is a touch-event
+ // handler in the page, or some touch-event is already in the queue,
+ // even if no point has been updated. This ensures that this event
+ // does not get processed by the gesture recognizer before events
+ // currently awaiting dispatch in the touch queue.
+ if (host_->ShouldForwardTouchEvent()) {
+ event->DisableSynchronousHandling();
+ host_->ForwardTouchEventWithLatencyInfo(touch_event_, *event->latency());
+ }
+ UpdateWebTouchEventAfterDispatch(&touch_event_, point);
}
void RenderWidgetHostViewAura::OnGestureEvent(ui::GestureEvent* event) {

Powered by Google App Engine
This is Rietveld 408576698