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

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

Issue 1650983002: Add an IsBootstrapped method to the SiteEngagementService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@adjust_constants
Patch Set: address comments Created 4 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/engagement/site_engagement_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5c9156ceba449e125eb794c7a1dbf4a2a8c6e88d..fc0f3dab206470483ecad098bd95724b380f2721 100644
--- a/chrome/browser/engagement/site_engagement_service.h
+++ b/chrome/browser/engagement/site_engagement_service.h
@@ -60,6 +60,10 @@ class SiteEngagementScore {
// each site.
FIRST_DAILY_ENGAGEMENT,
+ // The number of points that the engagement service must accumulate to be
+ // considered 'useful'.
+ BOOTSTRAP_POINTS,
+
MAX_VARIATION
};
@@ -75,6 +79,7 @@ class SiteEngagementScore {
static double GetHiddenMediaPoints();
static double GetWebAppInstalledPoints();
static double GetFirstDailyEngagementPoints();
+ static double GetBootstrapPoints();
// Update the default engagement settings via variations.
static void UpdateFromVariations();
@@ -197,6 +202,11 @@ class SiteEngagementService : public KeyedService,
// Returns a map of all stored origins and their engagement scores.
std::map<GURL, double> GetScoreMap();
+ // Returns whether the engagement service has enough data to make meaningful
+ // decisions. Clients should avoid using engagement in their heuristic until
+ // this is true.
+ bool IsBootstrapped();
+
// Update the engagement score of the origin matching |url| for navigation.
void HandleNavigation(const GURL& url, ui::PageTransition transition);
@@ -238,6 +248,7 @@ class SiteEngagementService : public KeyedService,
FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest, LastShortcutLaunch);
FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest,
CleanupOriginsOnHistoryDeletion);
+ FRIEND_TEST_ALL_PREFIXES(SiteEngagementServiceTest, IsBootstrapped);
FRIEND_TEST_ALL_PREFIXES(AppBannerSettingsHelperTest, SiteEngagementTrigger);
// Only used in tests.
« no previous file with comments | « no previous file | chrome/browser/engagement/site_engagement_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698