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..091e18817ec847eddcaf6601d2b08167923352cb 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(), |
Charlie Reis
2016/02/25 18:28:02
Side question: Would you be a good person to chat
dominickn
2016/02/26 00:36:11
I'm by no means an expert on the widget hierarchy,
|
+ blink::WebInputEvent::Undefined); |
} |
void WebContentsImpl::SetClosedByUserGesture(bool value) { |
@@ -4346,23 +4347,23 @@ 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. |
Charlie Reis
2016/02/25 18:28:02
We should probably have a TODO here to support wid
dominickn
2016/02/26 00:36:11
Done.
|
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()); |