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

Side by Side Diff: chrome/browser/metrics/desktop_engagement/desktop_engagement_observer.h

Issue 2142983002: Add desktop engagement metrics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_METRICS_DESKTOP_ENGAGEMENT_DESKTOP_ENGAGEMENT_OBSERVER_H_
6 #define CHROME_BROWSER_METRICS_DESKTOP_ENGAGEMENT_DESKTOP_ENGAGEMENT_OBSERVER_H_
7
8 #include "base/macros.h"
9 #include "content/public/browser/render_widget_host.h"
10 #include "content/public/browser/web_contents.h"
11 #include "content/public/browser/web_contents_observer.h"
12 #include "content/public/browser/web_contents_user_data.h"
13 #include "third_party/WebKit/public/web/WebInputEvent.h"
14
15 class DesktopEngagementService;
16
17 // Class for tracking user interaction with the browser.
18 class DesktopEngagementObserver
19 : public content::WebContentsObserver,
20 public content::WebContentsUserData<DesktopEngagementObserver>,
21 public content::RenderWidgetHost::InputEventObserver {
22 public:
23 DesktopEngagementObserver(content::WebContents* web_contents,
24 DesktopEngagementService* service);
25 ~DesktopEngagementObserver() override;
26
27 static DesktopEngagementObserver* CreateForWebContents(
28 content::WebContents* web_contents);
29
30 private:
31 friend class content::WebContentsUserData<DesktopEngagementObserver>;
32
33 // Register / Unregister input event callback to given RenderViewHost
34 void RegisterInputEventObserver(content::RenderViewHost* host);
35 void UnregisterInputEventObserver(content::RenderViewHost* host);
36
37 // content::RenderWidgetHost::InputEventObserver:
38 void OnInputEvent(const blink::WebInputEvent& event) override;
39
40 // content::WebContentsObserver:
41 void RenderViewHostChanged(content::RenderViewHost* old_host,
42 content::RenderViewHost* new_host) override;
43
44 DesktopEngagementService* service_;
45
46 DISALLOW_COPY_AND_ASSIGN(DesktopEngagementObserver);
47 };
48
49 #endif // CHROME_BROWSER_METRICS_DESKTOP_ENGAGEMENT_DESKTOP_ENGAGEMENT_OBSERVER _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698