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)); |
+} |