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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1735833002: Remove WebContentsObserver::DidGetUserGesture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing reviewer comment Created 4 years, 10 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
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/web_contents_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/browser/web_contents_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698