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

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: fixes Created 4 years, 4 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 namespace metrics {
16
17 class DesktopEngagementService;
18
19 // Class for tracking user interaction with the browser.
Alexei Svitkine (slow) 2016/07/28 18:37:22 Please make explain this more. You can omit "Clas
gayane -on leave until 09-2017 2016/07/28 21:21:34 Done.
20 class DesktopEngagementObserver
21 : public content::WebContentsObserver,
22 public content::WebContentsUserData<DesktopEngagementObserver>,
23 public content::RenderWidgetHost::InputEventObserver {
24 public:
25 DesktopEngagementObserver(content::WebContents* web_contents,
26 DesktopEngagementService* service);
27 ~DesktopEngagementObserver() override;
28
29 static DesktopEngagementObserver* CreateForWebContents(
30 content::WebContents* web_contents);
31
32 private:
33 friend class content::WebContentsUserData<DesktopEngagementObserver>;
34
35 // Register / Unregister input event callback to given RenderViewHost
36 void RegisterInputEventObserver(content::RenderViewHost* host);
37 void UnregisterInputEventObserver(content::RenderViewHost* host);
38
39 // content::RenderWidgetHost::InputEventObserver:
40 void OnInputEvent(const blink::WebInputEvent& event) override;
41
42 // content::WebContentsObserver:
43 void RenderViewHostChanged(content::RenderViewHost* old_host,
44 content::RenderViewHost* new_host) override;
45
46 DesktopEngagementService* service_;
47
48 DISALLOW_COPY_AND_ASSIGN(DesktopEngagementObserver);
49 };
50
51 } // namespace metrics
52
53 #endif // CHROME_BROWSER_METRICS_DESKTOP_ENGAGEMENT_DESKTOP_ENGAGEMENT_OBSERVER _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698