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); |