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

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

Issue 2042243004: Construct the site engagement helper with a site engagement service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address reviewer comments, rebase to fix leak Created 4 years, 6 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: chrome/browser/engagement/site_engagement_service.h
diff --git a/chrome/browser/engagement/site_engagement_service.h b/chrome/browser/engagement/site_engagement_service.h
index 31ead8b7945a327efa2289c2acd00b3de3f4b435..e18e9808a9fbda9d7871e3a90cb7d759a50293f1 100644
--- a/chrome/browser/engagement/site_engagement_service.h
+++ b/chrome/browser/engagement/site_engagement_service.h
@@ -23,6 +23,10 @@ class DictionaryValue;
class Clock;
}
+namespace content {
+class WebContents;
+}
+
namespace history {
class HistoryService;
}
@@ -144,17 +148,19 @@ class SiteEngagementService : public KeyedService,
// Returns the median engagement score of all recorded origins.
double GetMedianEngagement(const std::map<GURL, double>& score_map) const;
- // Update the engagement score of the origin matching |url| for media playing.
- // The points awarded are discounted if the media is being played in a non-
- // visible tab.
- void HandleMediaPlaying(const GURL& url, bool is_hidden);
+ // Update the engagement score of the origin loaded in |web_contents| for
+ // media playing. The points awarded are discounted if the media is being
+ // played in a non-visible tab.
+ void HandleMediaPlaying(content::WebContents* web_contents, bool is_hidden);
- // Update the engagement score of the origin matching |url| for navigation.
- void HandleNavigation(const GURL& url, ui::PageTransition transition);
+ // Update the engagement score of the origin loaded in |web_contents| for
+ // navigation.
+ void HandleNavigation(content::WebContents* web_contents,
+ ui::PageTransition transition);
- // Update the engagement score of the origin matching |url| for time-on-site,
- // based on user input.
- void HandleUserInput(const GURL& url,
+ // Update the engagement score of the origin loaded in |web_contents| for
+ // time-on-site, based on user input.
+ void HandleUserInput(content::WebContents* web_contents,
SiteEngagementMetrics::EngagementType type);
// Overridden from history::HistoryServiceObserver:

Powered by Google App Engine
This is Rietveld 408576698