Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_SCORE_H_ | 5 #ifndef CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SCORE_H_ |
| 6 #define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SCORE_H_ | 6 #define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SCORE_H_ |
| 7 | 7 |
| 8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 MAX_POINTS_PER_DAY = 0, | 23 MAX_POINTS_PER_DAY = 0, |
| 24 | 24 |
| 25 // The period over which site engagement decays. | 25 // The period over which site engagement decays. |
| 26 DECAY_PERIOD_IN_DAYS, | 26 DECAY_PERIOD_IN_DAYS, |
| 27 | 27 |
| 28 // The number of points to decay per period. | 28 // The number of points to decay per period. |
| 29 DECAY_POINTS, | 29 DECAY_POINTS, |
| 30 | 30 |
| 31 // The number of points given for navigations. | 31 // The number of points given for navigations. |
| 32 NAVIGATION_POINTS, | 32 NAVIGATION_POINTS, |
| 33 POINTS_INCREMENT_FIRST = NAVIGATION_POINTS, | |
| 33 | 34 |
| 34 // The number of points given for user input. | 35 // The number of points given for user input. |
| 35 USER_INPUT_POINTS, | 36 USER_INPUT_POINTS, |
| 36 | 37 |
| 37 // The number of points given for media playing. Initially calibrated such | 38 // The number of points given for media playing. Initially calibrated such |
| 38 // that at least 30 minutes of foreground media would be required to allow a | 39 // that at least 30 minutes of foreground media would be required to allow a |
| 39 // site to reach the daily engagement maximum. | 40 // site to reach the daily engagement maximum. |
| 40 VISIBLE_MEDIA_POINTS, | 41 VISIBLE_MEDIA_POINTS, |
| 41 HIDDEN_MEDIA_POINTS, | 42 HIDDEN_MEDIA_POINTS, |
| 43 POINTS_INCREMENT_LAST = HIDDEN_MEDIA_POINTS, | |
|
calamity
2016/05/24 08:09:32
This won't work if we add a new increment type to
dominickn
2016/05/25 07:21:32
Is there any reason to keep this enum append only?
calamity
2016/05/31 05:56:35
Guess not. This whole 3-way mapping is getting a b
| |
| 42 | 44 |
| 43 // The number of points added to engagement when a site is launched from | 45 // The number of points added to engagement when a site is launched from |
| 44 // homescreen or added as a bookmark app. This bonus will apply for ten days | 46 // homescreen or added as a bookmark app. This bonus will apply for ten days |
| 45 // following a launch; each new launch resets the ten days. | 47 // following a launch; each new launch resets the ten days. |
| 46 WEB_APP_INSTALLED_POINTS, | 48 WEB_APP_INSTALLED_POINTS, |
| 47 | 49 |
| 48 // The number of points given for the first engagement event of the day for | 50 // The number of points given for the first engagement event of the day for |
| 49 // each site. | 51 // each site. |
| 50 FIRST_DAILY_ENGAGEMENT, | 52 FIRST_DAILY_ENGAGEMENT, |
| 51 | 53 |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 69 static double GetDecayPoints(); | 71 static double GetDecayPoints(); |
| 70 static double GetNavigationPoints(); | 72 static double GetNavigationPoints(); |
| 71 static double GetUserInputPoints(); | 73 static double GetUserInputPoints(); |
| 72 static double GetVisibleMediaPoints(); | 74 static double GetVisibleMediaPoints(); |
| 73 static double GetHiddenMediaPoints(); | 75 static double GetHiddenMediaPoints(); |
| 74 static double GetWebAppInstalledPoints(); | 76 static double GetWebAppInstalledPoints(); |
| 75 static double GetFirstDailyEngagementPoints(); | 77 static double GetFirstDailyEngagementPoints(); |
| 76 static double GetBootstrapPoints(); | 78 static double GetBootstrapPoints(); |
| 77 static double GetMediumEngagementBoundary(); | 79 static double GetMediumEngagementBoundary(); |
| 78 static double GetHighEngagementBoundary(); | 80 static double GetHighEngagementBoundary(); |
| 81 static double GetMinimumEngagementIncrement(); | |
| 79 | 82 |
| 80 // Update the default engagement settings via variations. | 83 // Update the default engagement settings via variations. |
| 81 static void UpdateFromVariations(const char* param_name); | 84 static void UpdateFromVariations(const char* param_name); |
| 82 | 85 |
| 83 // The SiteEngagementScore does not take ownership of |clock|. It is the | 86 // The SiteEngagementScore does not take ownership of |clock|. It is the |
| 84 // responsibility of the caller to make sure |clock| outlives this | 87 // responsibility of the caller to make sure |clock| outlives this |
| 85 // SiteEngagementScore. | 88 // SiteEngagementScore. |
| 86 SiteEngagementScore(base::Clock* clock, | 89 SiteEngagementScore(base::Clock* clock, |
| 87 const base::DictionaryValue& score_dict); | 90 const base::DictionaryValue& score_dict); |
| 88 ~SiteEngagementScore(); | 91 ~SiteEngagementScore(); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 168 base::Time last_engagement_time_; | 171 base::Time last_engagement_time_; |
| 169 | 172 |
| 170 // The last time the site with this score was launched from an installed | 173 // The last time the site with this score was launched from an installed |
| 171 // shortcut. | 174 // shortcut. |
| 172 base::Time last_shortcut_launch_time_; | 175 base::Time last_shortcut_launch_time_; |
| 173 | 176 |
| 174 DISALLOW_COPY_AND_ASSIGN(SiteEngagementScore); | 177 DISALLOW_COPY_AND_ASSIGN(SiteEngagementScore); |
| 175 }; | 178 }; |
| 176 | 179 |
| 177 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SCORE_H_ | 180 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_SCORE_H_ |
| OLD | NEW |