Index: chrome/browser/engagement/important_sites_util.h |
diff --git a/chrome/browser/engagement/important_sites_util.h b/chrome/browser/engagement/important_sites_util.h |
index 364da285f30c9036214524bce3d0bdab493af516..161817948b2fccdb6332ff4bbb5f96ac4f136ee7 100644 |
--- a/chrome/browser/engagement/important_sites_util.h |
+++ b/chrome/browser/engagement/important_sites_util.h |
@@ -17,13 +17,24 @@ namespace user_prefs { |
class PrefRegistrySyncable; |
} |
+// Helper methods for important sites. |
+// All methods should be used on the UI thread. |
class ImportantSitesUtil { |
public: |
+#if defined(OS_ANDROID) |
+ static const int kMaxImportantSites = 5; |
+#else |
+ static const int kMaxImportantSites = 10; |
+#endif |
+ |
struct ImportantDomainInfo { |
std::string registerable_domain; |
GURL example_origin; |
double engagement_score = 0; |
int32_t reason_bitfield = 0; |
+ // |usage| has to be initialized by ImportantSitesUsageCounter before it |
+ // will contain the number of bytes used for quota and localstorage. |
+ int64_t usage = 0; |
}; |
// Do not change the values here, as they are used for UMA histograms. |
@@ -36,6 +47,10 @@ class ImportantSitesUtil { |
REASON_BOUNDARY |
}; |
+ static std::string GetRegisterableDomainOrIP(const GURL& url); |
+ |
+ static std::string GetRegisterableDomainOrIPFromHost(base::StringPiece host); |
+ |
static bool IsDialogDisabled(Profile* profile); |
static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |