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 397a167b8eeb40a71c0149a69cd9fce007f5cd71..605a1671ce6b2662de7af4873cf4c2ddce24d013 100644 |
--- a/chrome/browser/engagement/site_engagement_service.h |
+++ b/chrome/browser/engagement/site_engagement_service.h |
@@ -38,6 +38,14 @@ class SiteEngagementScore { |
// The number of points given for user input (indicating time-on-site). |
static double g_user_input_points; |
+ // The number of points given for media playing. Initially calibrated such |
+ // that at least 30 minutes of video watching or audio listening would be |
+ // required to allow a site to reach the daily engagement maximum. |
+ static double g_visible_media_playing_points; |
+ |
+ // The number of points given for media playing in a non-visible tab. |
+ static double g_hidden_media_playing_points; |
+ |
// Decaying works by removing a portion of the score periodically. This |
// constant determines how often that happens. |
static int g_decay_period_in_days; |
@@ -146,6 +154,11 @@ class SiteEngagementService : public KeyedService, |
void HandleUserInput(const GURL& url, |
SiteEngagementMetrics::EngagementType type); |
+ // Update the karma score of the origin matching |url| for media playing. The |
+ // points awarded are discounted if the media is being played in a non-visible |
+ // tab. |
+ void HandleMediaPlaying(const GURL& url, bool is_hidden); |
+ |
// Overridden from SiteEngagementScoreProvider: |
double GetScore(const GURL& url) override; |
double GetTotalEngagementPoints() override; |