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

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

Issue 1373453002: Allow the site engagement service thresholds to be varied via field trial. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@time-on-site-uma
Patch Set: Reviewer nits Created 5 years, 2 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 | « no previous file | chrome/browser/engagement/site_engagement_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e5735605a60285b633ed3707c2a439ed21cd6669..f2e067705f5beadacd265edeb7d067566a82ab79 100644
--- a/chrome/browser/engagement/site_engagement_service.h
+++ b/chrome/browser/engagement/site_engagement_service.h
@@ -25,29 +25,27 @@ class Profile;
class SiteEngagementScore {
public:
- // Keys used in the content settings dictionary.
- static const char* kRawScoreKey;
- static const char* kPointsAddedTodayKey;
- static const char* kLastEngagementTimeKey;
-
// The maximum number of points that are allowed.
static const double kMaxPoints;
// The maximum number of points that can be accrued in one day.
- static const double kMaxPointsPerDay;
+ static double g_max_points_per_day;
// The number of points given for navigations.
- static const double kNavigationPoints;
+ static double g_navigation_points;
// The number of points given for user input (indicating time-on-site).
- static const double kUserInputPoints;
+ static double g_user_input_points;
// Decaying works by removing a portion of the score periodically. This
// constant determines how often that happens.
- static const int kDecayPeriodInDays;
+ static int g_decay_period_in_days;
// How much the score decays after every kDecayPeriodInDays.
- static const double kDecayPoints;
+ static double g_decay_points;
+
+ // Update the default engagement settings via variations.
+ static void UpdateFromVariations();
// The SiteEngagementService does not take ownership of |clock|. It is the
// responsibility of the caller to make sure |clock| outlives this
@@ -67,8 +65,15 @@ class SiteEngagementScore {
bool UpdateScoreDict(base::DictionaryValue* score_dict);
private:
+ FRIEND_TEST_ALL_PREFIXES(SiteEngagementScoreTest, PartiallyEmptyDictionary);
+ FRIEND_TEST_ALL_PREFIXES(SiteEngagementScoreTest, PopulatedDictionary);
friend class SiteEngagementScoreTest;
+ // Keys used in the content settings dictionary.
+ static const char* kRawScoreKey;
+ static const char* kPointsAddedTodayKey;
+ static const char* kLastEngagementTimeKey;
+
// This version of the constructor is used in unit tests.
explicit SiteEngagementScore(base::Clock* clock);
« no previous file with comments | « no previous file | chrome/browser/engagement/site_engagement_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698