| Index: content/browser/web_contents/web_contents_impl.cc
|
| diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
| index 2b7899e8584ea7cea0781d4e4bfa8a397d579253..c5ac495f3fa991f582552bbe19e957bfb45d513c 100644
|
| --- a/content/browser/web_contents/web_contents_impl.cc
|
| +++ b/content/browser/web_contents/web_contents_impl.cc
|
| @@ -2727,7 +2727,8 @@ void WebContentsImpl::SystemDragEnded() {
|
| }
|
|
|
| void WebContentsImpl::UserGestureDone() {
|
| - OnUserGesture(GetRenderViewHost()->GetWidget());
|
| + OnUserInteraction(GetRenderViewHost()->GetWidget(),
|
| + blink::WebInputEvent::Undefined);
|
| }
|
|
|
| void WebContentsImpl::SetClosedByUserGesture(bool value) {
|
| @@ -4346,23 +4347,24 @@ int WebContentsImpl::CreateSwappedOutRenderView(
|
| return render_view_routing_id;
|
| }
|
|
|
| -void WebContentsImpl::OnUserGesture(RenderWidgetHostImpl* render_widget_host) {
|
| +void WebContentsImpl::OnUserInteraction(
|
| + RenderWidgetHostImpl* render_widget_host,
|
| + const blink::WebInputEvent::Type type) {
|
| + // Ignore when the renderer is swapped out.
|
| + // TODO(dominickn,creis): support widgets for out-of-process iframes.
|
| if (render_widget_host != GetRenderViewHost()->GetWidget())
|
| return;
|
|
|
| - // Notify observers.
|
| - FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidGetUserGesture());
|
| + FOR_EACH_OBSERVER(WebContentsObserver, observers_,
|
| + DidGetUserInteraction(type));
|
|
|
| ResourceDispatcherHostImpl* rdh = ResourceDispatcherHostImpl::Get();
|
| - if (rdh) // NULL in unittests.
|
| + // Exclude scroll events as user gestures for resource load dispatches.
|
| + // rdh is NULL in unittests.
|
| + if (rdh && type != blink::WebInputEvent::MouseWheel)
|
| rdh->OnUserGesture(this);
|
| }
|
|
|
| -void WebContentsImpl::OnUserInteraction(const blink::WebInputEvent::Type type) {
|
| - FOR_EACH_OBSERVER(WebContentsObserver, observers_,
|
| - DidGetUserInteraction(type));
|
| -}
|
| -
|
| void WebContentsImpl::OnIgnoredUIEvent() {
|
| // Notify observers.
|
| FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidGetIgnoredUIEvent());
|
|
|