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

Unified Diff: content/public/browser/web_contents_observer.h

Issue 1388293002: Notify WebContentsObservers of user interactions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactoring site engagement to use DidGetUserInteraction Created 5 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/public/browser/web_contents_observer.h
diff --git a/content/public/browser/web_contents_observer.h b/content/public/browser/web_contents_observer.h
index c2fcffbe0f2efb50491184386b27a6aa11d21753..508c1aceefe6dad56c2b3af07acbbccf1cfcaa54 100644
--- a/content/public/browser/web_contents_observer.h
+++ b/content/public/browser/web_contents_observer.h
@@ -13,6 +13,7 @@
#include "content/public/common/security_style.h"
#include "ipc/ipc_listener.h"
#include "ipc/ipc_sender.h"
+#include "third_party/WebKit/public/web/WebInputEvent.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/page_transition_types.h"
#include "ui/base/window_open_disposition.h"
@@ -313,8 +314,15 @@ class CONTENT_EXPORT WebContentsObserver : public IPC::Listener,
virtual void NavigationStopped() {}
// This indicates that the next navigation was triggered by a user gesture.
+ // TODO(dominickn): remove this method in favor of DidGetUserInteraction,
+ // with the appropriate filtering by input event type.
nasko 2015/10/27 13:41:19 Is this TODO expected to be resolved in this CL?
dominickn 2015/10/27 23:21:53 No, I was planning on doing that in a separate CL.
nasko 2015/10/28 17:36:12 I don't have very strong preference which way it h
virtual void DidGetUserGesture() {}
+ // Called when there has been direct user interaction with the web contents.
nasko 2015/10/27 13:41:19 nit: s/web contents/WebContents/
dominickn 2015/10/27 23:21:53 Done.
+ // Direct user input includes 1) any mouse down event; 2) any mouse wheel
+ // event; 3) any raw key down event; and 4) any gesture tap event.
+ virtual void DidGetUserInteraction(const blink::WebInputEvent::Type type) {}
+
// This method is invoked when a RenderViewHost of this WebContents was
// configured to ignore UI events, and an UI event took place.
virtual void DidGetIgnoredUIEvent() {}

Powered by Google App Engine
This is Rietveld 408576698