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

Unified Diff: chrome/browser/engagement/site_engagement_service.h

Issue 1427913002: Implement media playing engagement detection for the site engagement service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@user-input-event
Patch Set: Addressing nits Created 5 years, 1 month 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_service.h
diff --git a/chrome/browser/engagement/site_engagement_service.h b/chrome/browser/engagement/site_engagement_service.h
index 36b1fd2749788f99be582dd1d8e83e9544af7c31..85dca081d9770655443df8d74bed20efd323f7c8 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;
@@ -149,6 +157,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;
« no previous file with comments | « chrome/browser/engagement/site_engagement_metrics.h ('k') | chrome/browser/engagement/site_engagement_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698