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

Unified Diff: chrome/browser/engagement/site_engagement_helper.h

Issue 1077063002: Implement a basic Site Engagement Score service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback Created 5 years, 8 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 | « chrome/browser/engagement/OWNERS ('k') | chrome/browser/engagement/site_engagement_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/engagement/site_engagement_helper.h
diff --git a/chrome/browser/engagement/site_engagement_helper.h b/chrome/browser/engagement/site_engagement_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..c3883d5cf41a1363e67469f1c0e0bcf2d7635844
--- /dev/null
+++ b/chrome/browser/engagement/site_engagement_helper.h
@@ -0,0 +1,38 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_HELPER_H_
+#define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_HELPER_H_
+
+#include "base/macros.h"
+#include "content/public/browser/web_contents_observer.h"
+#include "content/public/browser/web_contents_user_data.h"
+
+namespace content {
+class WebContents;
+}
+
+class GURL;
+
+// Per-WebContents class to handle updating the site engagement scores for
+// origins as the user navigates.
+class SiteEngagementHelper
+ : public content::WebContentsObserver,
+ public content::WebContentsUserData<SiteEngagementHelper> {
+ public:
+ ~SiteEngagementHelper() override;
+
+ private:
+ explicit SiteEngagementHelper(content::WebContents* web_contents);
+ friend class content::WebContentsUserData<SiteEngagementHelper>;
+
+ // content::WebContentsObserver overrides.
+ void DidStartNavigationToPendingEntry(
+ const GURL& url,
+ content::NavigationController::ReloadType reload_type) override;
+
+ DISALLOW_COPY_AND_ASSIGN(SiteEngagementHelper);
+};
+
+#endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_HELPER_H_
« no previous file with comments | « chrome/browser/engagement/OWNERS ('k') | chrome/browser/engagement/site_engagement_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698