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

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: Created 4 years, 11 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 5c9156ceba449e125eb794c7a1dbf4a2a8c6e88d..6787469b3572c286e5553756b9a723e238f262b0 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,10 @@ 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.
+ bool IsBootstrapped();
+
// Update the engagement score of the origin matching |url| for navigation.
void HandleNavigation(const GURL& url, ui::PageTransition transition);
@@ -238,6 +247,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.

Powered by Google App Engine
This is Rietveld 408576698