Index: chrome/browser/engagement/site_engagement_service.cc |
diff --git a/chrome/browser/engagement/site_engagement_service.cc b/chrome/browser/engagement/site_engagement_service.cc |
index edda88c4b38d468b73d20c7465cc203aec8c1342..132d9e1327800b20787220ff36866787e3621557 100644 |
--- a/chrome/browser/engagement/site_engagement_service.cc |
+++ b/chrome/browser/engagement/site_engagement_service.cc |
@@ -475,8 +475,9 @@ void SiteEngagementService::HandleMediaPlaying( |
: SiteEngagementScore::GetVisibleMediaPoints()); |
RecordMetrics(); |
+ double score = GetScore(url); |
for (SiteEngagementObserver& observer : observer_list_) |
- observer.OnEngagementIncreased(web_contents, url, GetScore(url)); |
+ observer.OnEngagementIncreased(web_contents, url, score); |
} |
void SiteEngagementService::HandleNavigation(content::WebContents* web_contents, |
@@ -490,8 +491,9 @@ void SiteEngagementService::HandleNavigation(content::WebContents* web_contents, |
AddPoints(url, SiteEngagementScore::GetNavigationPoints()); |
RecordMetrics(); |
+ double score = GetScore(url); |
for (SiteEngagementObserver& observer : observer_list_) |
- observer.OnEngagementIncreased(web_contents, url, GetScore(url)); |
+ observer.OnEngagementIncreased(web_contents, url, score); |
} |
void SiteEngagementService::HandleUserInput( |
@@ -505,8 +507,23 @@ void SiteEngagementService::HandleUserInput( |
AddPoints(url, SiteEngagementScore::GetUserInputPoints()); |
RecordMetrics(); |
+ double score = GetScore(url); |
+ for (SiteEngagementObserver& observer : observer_list_) |
+ observer.OnEngagementIncreased(web_contents, url, score); |
+} |
+ |
+void SiteEngagementService::HandleNotificationInteraction(const GURL& url) { |
+ if (!ShouldRecordEngagement(url)) |
+ return; |
+ |
+ SiteEngagementMetrics::RecordEngagement( |
+ SiteEngagementMetrics::ENGAGEMENT_NOTIFICATION_INTERACTION); |
+ AddPoints(url, SiteEngagementScore::GetNotificationInteractionPoints()); |
+ |
+ RecordMetrics(); |
+ double score = GetScore(url); |
for (SiteEngagementObserver& observer : observer_list_) |
- observer.OnEngagementIncreased(web_contents, url, GetScore(url)); |
+ observer.OnEngagementIncreased(nullptr, url, score); |
} |
void SiteEngagementService::SendLevelChangeToHelpers( |