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

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

Issue 1368533004: Add UMA metrics to the site engagement service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@time-on-site
Patch Set: Created 5 years, 3 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 de3e9d1024c6bc6aeb92f3a089bfc0c228bc0ed8..0e67b7193bb982ef6326824fa498f8ab7122e5e6 100644
--- a/chrome/browser/engagement/site_engagement_service.h
+++ b/chrome/browser/engagement/site_engagement_service.h
@@ -57,6 +57,10 @@ class SiteEngagementScore {
double Score() const;
void AddPoints(double points);
+ // Returns true if the maximum number of points today has been added. Resets
+ // the number of points added today if the day has changed.
+ bool MaxPointsPerDayAdded();
+
// Updates the content settings dictionary |score_dict| with the current score
// fields. Returns true if |score_dict| changed, otherwise return false.
bool UpdateScoreDict(base::DictionaryValue* score_dict);
@@ -135,8 +139,19 @@ class SiteEngagementService : public KeyedService,
double GetTotalEngagementPoints() override;
private:
+ // Adds the specified number of points to the given origin, respecting the
+ // maximum limits for the day and overall.
calamity 2015/09/25 07:08:33 nit: This should be moved into the previous CL but
dominickn 2015/09/28 03:34:50 Done.
void AddPoints(const GURL& url, double points);
+ // Returns the number of origins with maximum daily and total engagement
+ // respectively.
+ int OriginsWithMaxDailyEngagement();
+ int OriginsWithMaxEngagement();
+
+ // Logs the total number of origins stored by the site engagement service, and
+ // the total accumulated engagement score.
+ void RecordStartupUmaStats();
+
Profile* profile_;
// The clock used to vend times.

Powered by Google App Engine
This is Rietveld 408576698