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

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

Issue 2788413003: Add SiteEngagementService::GetAllDetails(), to return detailed scores. (Closed)
Patch Set: Rename score->total_score and GetScore->GetTotal Created 3 years, 8 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_service.h
diff --git a/chrome/browser/engagement/site_engagement_service.h b/chrome/browser/engagement/site_engagement_service.h
index 35c005d1af69eefa392635567bbcf358f053b12c..e5879e8a1011cf571cfe341f2887f0feb625146c 100644
--- a/chrome/browser/engagement/site_engagement_service.h
+++ b/chrome/browser/engagement/site_engagement_service.h
@@ -15,6 +15,7 @@
#include "base/observer_list.h"
#include "base/time/time.h"
#include "build/build_config.h"
+#include "chrome/browser/engagement/site_engagement_details.mojom.h"
#include "chrome/browser/engagement/site_engagement_metrics.h"
#include "chrome/browser/engagement/site_engagement_observer.h"
#include "components/history/core/browser/history_service_observer.h"
@@ -116,7 +117,12 @@ class SiteEngagementService : public KeyedService,
// Returns the engagement level of |url|.
blink::mojom::EngagementLevel GetEngagementLevel(const GURL& url) const;
+ // Returns SiteEngagementDetails structures describing the score details for
+ // all stored origins.
+ std::vector<mojom::SiteEngagementDetails> GetScoreDetails() const;
+
// Returns a map of all stored origins and their engagement scores.
+ // TODO(wez): Remove this!
Wez 2017/04/10 03:45:28 AFAICT the only callers of this are: 1. to calcula
std::map<GURL, double> GetScoreMap() const;
// Update the engagement score of |url| for a notification interaction.
@@ -143,6 +149,9 @@ class SiteEngagementService : public KeyedService,
void HelperCreated(SiteEngagementService::Helper* helper);
void HelperDeleted(SiteEngagementService::Helper* helper);
+ // Returns the site engagement details for the specified |url|.
+ mojom::SiteEngagementDetails GetScoreDetails(const GURL& url) const;
+
// Overridden from SiteEngagementScoreProvider.
double GetScore(const GURL& url) const override;
double GetTotalEngagementPoints() const override;

Powered by Google App Engine
This is Rietveld 408576698