Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 static const char* kLastShortcutLaunchTimeKey; | 124 static const char* kLastShortcutLaunchTimeKey; |
| 125 | 125 |
| 126 // This version of the constructor is used in unit tests. | 126 // This version of the constructor is used in unit tests. |
| 127 explicit SiteEngagementScore(base::Clock* clock); | 127 explicit SiteEngagementScore(base::Clock* clock); |
| 128 | 128 |
| 129 // Determine the score, accounting for any decay. | 129 // Determine the score, accounting for any decay. |
| 130 double DecayedScore() const; | 130 double DecayedScore() const; |
| 131 | 131 |
| 132 // Determine any score bonus from having installed shortcuts. | 132 // Determine any score bonus from having installed shortcuts. |
| 133 double BonusScore() const; | 133 double BonusScore() const; |
| 134 | 134 |
|
dominickn
2016/01/25 03:04:57
Nit: add a comment along the lines of "Sets fixed
calamity
2016/01/27 03:47:23
Done.
| |
| 135 static void DisableFirstDailyEngagementBonusForTesting(); | 135 static void SetParamValuesForTesting(); |
| 136 | 136 |
| 137 // The clock used to vend times. Enables time travelling in tests. Owned by | 137 // The clock used to vend times. Enables time travelling in tests. Owned by |
| 138 // the SiteEngagementService. | 138 // the SiteEngagementService. |
| 139 base::Clock* clock_; | 139 base::Clock* clock_; |
| 140 | 140 |
| 141 // |raw_score_| is the score before any decay is applied. | 141 // |raw_score_| is the score before any decay is applied. |
| 142 double raw_score_; | 142 double raw_score_; |
| 143 | 143 |
| 144 // The points added 'today' are tracked to avoid adding more than | 144 // The points added 'today' are tracked to avoid adding more than |
| 145 // kMaxPointsPerDay on any one day. 'Today' is defined in local time. | 145 // kMaxPointsPerDay on any one day. 'Today' is defined in local time. |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 273 // origin's engagement score after an hour has elapsed triggers the next | 273 // origin's engagement score after an hour has elapsed triggers the next |
| 274 // upload. | 274 // upload. |
| 275 base::Time last_metrics_time_; | 275 base::Time last_metrics_time_; |
| 276 | 276 |
| 277 base::WeakPtrFactory<SiteEngagementService> weak_factory_; | 277 base::WeakPtrFactory<SiteEngagementService> weak_factory_; |
| 278 | 278 |
| 279 DISALLOW_COPY_AND_ASSIGN(SiteEngagementService); | 279 DISALLOW_COPY_AND_ASSIGN(SiteEngagementService); |
| 280 }; | 280 }; |
| 281 | 281 |
| 282 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_H_ | 282 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SERVICE_H_ |
| OLD | NEW |