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

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

Issue 551373006: Re-enable Eager Gesture Recognition on Aura (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address sadrul's comments. Created 6 years, 2 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
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 a735aff095f707f38d36f69c7fe8b78be89dc7c5..beed162304772a68692049cdd5c6c8d091691b53 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -1168,7 +1168,7 @@ void RenderWidgetHostViewAura::ProcessAckedTouchEvent(
return;
aura::WindowTreeHost* host = window_->GetHost();
- // |host| is NULL during tests.
+ // |host| may be null during tests.
if (!host)
return;
@@ -2037,8 +2037,10 @@ void RenderWidgetHostViewAura::OnTouchEvent(ui::TouchEvent* event) {
return;
// Update the touch event first.
- blink::WebTouchPoint* point = UpdateWebTouchEventFromUIEvent(*event,
- &touch_event_);
+ blink::WebTouchPoint* point =
+ UpdateWebTouchEventFromUIEvent(*event, &touch_event_);
+
+ bool should_forward = host_->ShouldForwardTouchEvent();
// 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.
@@ -2046,14 +2048,17 @@ void RenderWidgetHostViewAura::OnTouchEvent(ui::TouchEvent* 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())
+ if (point && should_forward) {
+ DCHECK(window_->GetHost());
+ if (window_->GetHost()->dispatcher()->OnProcessingTouchEventAsync(event))
+ host_->ForwardTouchEventWithLatencyInfo(touch_event_, *event->latency());
+ }
+
+ if (should_forward)
event->StopPropagation();
- if (point) {
- if (host_->ShouldForwardTouchEvent())
- host_->ForwardTouchEventWithLatencyInfo(touch_event_, *event->latency());
+ if (point)
UpdateWebTouchEventAfterDispatch(&touch_event_, point);
- }
}
void RenderWidgetHostViewAura::OnGestureEvent(ui::GestureEvent* event) {

Powered by Google App Engine
This is Rietveld 408576698