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

Unified Diff: chrome/browser/engagement/site_engagement_score.cc

Issue 2748103011: Grant origins engagement for having interactions on their notifications. (Closed)
Patch Set: Created 3 years, 9 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
Index: chrome/browser/engagement/site_engagement_score.cc
diff --git a/chrome/browser/engagement/site_engagement_score.cc b/chrome/browser/engagement/site_engagement_score.cc
index a9493061cb627949e173049aacbfb36e85223116..95c232d585cc430edf80b0ffa9c4f2419159957f 100644
--- a/chrome/browser/engagement/site_engagement_score.cc
+++ b/chrome/browser/engagement/site_engagement_score.cc
@@ -92,6 +92,8 @@ SiteEngagementScore::ParamValues SiteEngagementScore::BuildParamValues() {
"last_engagement_grace_period_in_hours", 1};
param_values[NOTIFICATION_PERMISSION_POINTS] = {
"notification_permission_points", 5};
+ param_values[NOTIFICATION_INTERACTION_POINTS] = {
+ "notification_permission_points", 1};
return param_values;
}
@@ -163,6 +165,33 @@ double SiteEngagementScore::GetNotificationPermissionPoints() {
return GetParamValues()[NOTIFICATION_PERMISSION_POINTS].second;
}
+double SiteEngagementScore::GetNotificationInteractionPoints() {
+ return GetParamValues()[NOTIFICATION_INTERACTION_POINTS].second;
+}
+
+void SiteEngagementScore::SetParamValuesForTesting() {
+ GetParamValues()[MAX_POINTS_PER_DAY].second = 5;
+ GetParamValues()[DECAY_PERIOD_IN_HOURS].second = 7 * 24;
+ GetParamValues()[DECAY_POINTS].second = 5;
+ GetParamValues()[NAVIGATION_POINTS].second = 0.5;
+ GetParamValues()[USER_INPUT_POINTS].second = 0.05;
+ GetParamValues()[VISIBLE_MEDIA_POINTS].second = 0.02;
+ GetParamValues()[HIDDEN_MEDIA_POINTS].second = 0.01;
+ GetParamValues()[WEB_APP_INSTALLED_POINTS].second = 5;
+ GetParamValues()[BOOTSTRAP_POINTS].second = 8;
+ GetParamValues()[MEDIUM_ENGAGEMENT_BOUNDARY].second = 5;
+ GetParamValues()[HIGH_ENGAGEMENT_BOUNDARY].second = 50;
+ GetParamValues()[MAX_DECAYS_PER_SCORE].second = 1;
+ GetParamValues()[LAST_ENGAGEMENT_GRACE_PERIOD_IN_HOURS].second = 72;
+ GetParamValues()[NOTIFICATION_PERMISSION_POINTS].second = 5;
+ GetParamValues()[NOTIFICATION_INTERACTION_POINTS].second = 1;
+
+ // This is set to values that avoid interference with tests and are set when
+ // testing these features.
+ GetParamValues()[FIRST_DAILY_ENGAGEMENT].second = 0;
+ GetParamValues()[DECAY_PROPORTION].second = 1;
+ GetParamValues()[SCORE_CLEANUP_THRESHOLD].second = 0;
+}
// static
void SiteEngagementScore::UpdateFromVariations(const char* param_name) {
double param_vals[MAX_VARIATION];
@@ -388,26 +417,3 @@ double SiteEngagementScore::BonusScore() const {
return bonus;
}
-
-void SiteEngagementScore::SetParamValuesForTesting() {
- GetParamValues()[MAX_POINTS_PER_DAY].second = 5;
- GetParamValues()[DECAY_PERIOD_IN_HOURS].second = 7 * 24;
- GetParamValues()[DECAY_POINTS].second = 5;
- GetParamValues()[NAVIGATION_POINTS].second = 0.5;
- GetParamValues()[USER_INPUT_POINTS].second = 0.05;
- GetParamValues()[VISIBLE_MEDIA_POINTS].second = 0.02;
- GetParamValues()[HIDDEN_MEDIA_POINTS].second = 0.01;
- GetParamValues()[WEB_APP_INSTALLED_POINTS].second = 5;
- GetParamValues()[BOOTSTRAP_POINTS].second = 8;
- GetParamValues()[MEDIUM_ENGAGEMENT_BOUNDARY].second = 5;
- GetParamValues()[HIGH_ENGAGEMENT_BOUNDARY].second = 50;
- GetParamValues()[MAX_DECAYS_PER_SCORE].second = 1;
- GetParamValues()[LAST_ENGAGEMENT_GRACE_PERIOD_IN_HOURS].second = 72;
- GetParamValues()[NOTIFICATION_PERMISSION_POINTS].second = 5;
-
- // This is set to values that avoid interference with tests and are set when
- // testing these features.
- GetParamValues()[FIRST_DAILY_ENGAGEMENT].second = 0;
- GetParamValues()[DECAY_PROPORTION].second = 1;
- GetParamValues()[SCORE_CLEANUP_THRESHOLD].second = 0;
-}

Powered by Google App Engine
This is Rietveld 408576698