Chromium Code Reviews| 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 a7eb8d667baec6cc472c40178036fbbd5c092b27..ac10eafaa0707086c13293f7bff616668872473a 100644 |
| --- a/content/browser/renderer_host/render_widget_host_view_aura.cc |
| +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc |
| @@ -1163,7 +1163,7 @@ void RenderWidgetHostViewAura::ProcessAckedTouchEvent( |
| return; |
| aura::WindowTreeHost* host = window_->GetHost(); |
| - // |host| is NULL during tests. |
| + // |host| may be null during tests. |
| if (!host) |
| return; |
| @@ -2028,8 +2028,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. |
| @@ -2037,14 +2039,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()->OnForwardingAsyncTouchEvent(event)) |
| + host_->ForwardTouchEventWithLatencyInfo(touch_event_, *event->latency()); |
| + } |
| + |
| + if (should_forward) |
| event->StopPropagation(); |
|
jdduke (slow)
2014/10/22 17:51:02
Does it matter that the touch may have been ack'ed
tdresser
2014/10/22 18:24:08
In that case, we'll synchronously hit WindowEventD
|
| - if (point) { |
| - if (host_->ShouldForwardTouchEvent()) |
| - host_->ForwardTouchEventWithLatencyInfo(touch_event_, *event->latency()); |
| + if (point) |
| UpdateWebTouchEventAfterDispatch(&touch_event_, point); |
| - } |
| } |
| void RenderWidgetHostViewAura::OnGestureEvent(ui::GestureEvent* event) { |