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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_H_ 5 #ifndef CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_H_
6 #define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_H_ 6 #define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
(...skipping 10 matching lines...) Expand all
21 class GURL; 21 class GURL;
22 class Profile; 22 class Profile;
23 23
24 class SiteEngagementScore { 24 class SiteEngagementScore {
25 public: 25 public:
26 // Keys used in the content settings dictionary. 26 // Keys used in the content settings dictionary.
27 static const char* kRawScoreKey; 27 static const char* kRawScoreKey;
28 static const char* kPointsAddedTodayKey; 28 static const char* kPointsAddedTodayKey;
29 static const char* kLastEngagementTimeKey; 29 static const char* kLastEngagementTimeKey;
30 30
31 // Keys used in the variations params.
32 static const char* kEngagementParams;
33 static const char* kMaxPointsPerDayParam;
34 static const char* kNavigationPointsParam;
35 static const char* kUserInputPointsParam;
36 static const char* kDecayPeriodInDaysParam;
37 static const char* kDecayPointsParam;
benwells 2015/09/29 00:40:31 Do all these keys (and the content settings keys)
dominickn 2015/09/29 00:52:30 @calamity: any thoughts on making all of these pri
calamity 2015/10/01 08:41:19 These are just the keys, not the values? I don't
dominickn 2015/10/01 09:04:22 Done.
38
31 // The maximum number of points that are allowed. 39 // The maximum number of points that are allowed.
32 static const double kMaxPoints; 40 static const double kMaxPoints;
33 41
34 // The maximum number of points that can be accrued in one day. 42 // The maximum number of points that can be accrued in one day.
35 static const double kMaxPointsPerDay; 43 static double gMaxPointsPerDay;
36 44
37 // The number of points given for navigations. 45 // The number of points given for navigations.
38 static const double kNavigationPoints; 46 static double gNavigationPoints;
39 47
40 // The number of points given for user input (indicating time-on-site). 48 // The number of points given for user input (indicating time-on-site).
41 static const double kUserInputPoints; 49 static double gUserInputPoints;
42 50
43 // Decaying works by removing a portion of the score periodically. This 51 // Decaying works by removing a portion of the score periodically. This
44 // constant determines how often that happens. 52 // constant determines how often that happens.
45 static const int kDecayPeriodInDays; 53 static int gDecayPeriodInDays;
46 54
47 // How much the score decays after every kDecayPeriodInDays. 55 // How much the score decays after every kDecayPeriodInDays.
48 static const double kDecayPoints; 56 static double gDecayPoints;
calamity 2015/10/01 08:41:19 nit: g_decay_points and above to match majority of
calamity 2015/10/06 03:52:40 Ping? You can do this quickly by running sed -i
dominickn 2015/10/06 05:00:39 Done.
57
58 // Update the default engagement settings via variations.
59 static void UpdateFromVariations();
49 60
50 // The SiteEngagementService does not take ownership of |clock|. It is the 61 // The SiteEngagementService does not take ownership of |clock|. It is the
51 // responsibility of the caller to make sure |clock| outlives this 62 // responsibility of the caller to make sure |clock| outlives this
52 // SiteEngagementScore. 63 // SiteEngagementScore.
53 SiteEngagementScore(base::Clock* clock, 64 SiteEngagementScore(base::Clock* clock,
54 const base::DictionaryValue& score_dict); 65 const base::DictionaryValue& score_dict);
55 ~SiteEngagementScore(); 66 ~SiteEngagementScore();
56 67
57 double Score() const; 68 double Score() const;
58 void AddPoints(double points); 69 void AddPoints(double points);
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 165
155 Profile* profile_; 166 Profile* profile_;
156 167
157 // The clock used to vend times. 168 // The clock used to vend times.
158 base::DefaultClock clock_; 169 base::DefaultClock clock_;
159 170
160 DISALLOW_COPY_AND_ASSIGN(SiteEngagementService); 171 DISALLOW_COPY_AND_ASSIGN(SiteEngagementService);
161 }; 172 };
162 173
163 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_H_ 174 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698