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

Unified Diff: chrome/browser/android/preferences/important_sites_util.cc

Issue 1465363002: [Storage] Android - ManageSpace UI, Important Origins, and CBD Dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: whoops, forgot files Created 4 years, 7 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/android/preferences/important_sites_util.cc
diff --git a/chrome/browser/android/preferences/important_sites_util.cc b/chrome/browser/android/preferences/important_sites_util.cc
index ef09b81fc6efc59fd4df1c89c0ce6925e805ac0a..894d9dd78bc188b87b2c446ae8603d2e08ed219c 100644
--- a/chrome/browser/android/preferences/important_sites_util.cc
+++ b/chrome/browser/android/preferences/important_sites_util.cc
@@ -84,6 +84,8 @@ void FillTopRegisterableDomains(
net::registry_controlled_domains::GetDomainAndRegistry(
pair.first,
net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
+ if (registerable_domain.empty() && pair.first.HostIsIPAddress())
+ registerable_domain = pair.first.host();
// Just iterate to find, as we assume our size is small.
if (std::find(final_list->begin(), final_list->end(),
registerable_domain) == final_list->end()) {
@@ -125,3 +127,14 @@ std::vector<std::string> ImportantSitesUtil::GetImportantRegisterableDomains(
&final_list);
return final_list;
}
+
+void ImportantSitesUtil::MarkOriginAsImportantForTesting(Profile* profile,
+ const GURL& origin) {
+ // First get data from site engagement.
+ SiteEngagementService* site_engagement_service =
+ SiteEngagementService::Get(profile);
+ site_engagement_service->ResetScoreForURL(
+ origin, SiteEngagementScore::GetMediumEngagementBoundary());
+ DCHECK(site_engagement_service->IsEngagementAtLeast(
+ origin, SiteEngagementService::ENGAGEMENT_LEVEL_MEDIUM));
+}

Powered by Google App Engine
This is Rietveld 408576698