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

Unified Diff: components/omnibox/browser/history_url_provider.cc

Issue 2433583002: Reduce buggy usage of the registry controlled domain service. (Closed)
Patch Set: . Created 4 years, 2 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: components/omnibox/browser/history_url_provider.cc
diff --git a/components/omnibox/browser/history_url_provider.cc b/components/omnibox/browser/history_url_provider.cc
index 7adb668b51da2d10b065fa35f804e2acf78d8ff8..862c6d27bad99bc7965e825fe3aee490383d94ac 100644
--- a/components/omnibox/browser/history_url_provider.cc
+++ b/components/omnibox/browser/history_url_provider.cc
@@ -981,12 +981,12 @@ bool HistoryURLProvider::CanFindIntranetURL(
return false;
const std::string host(base::UTF16ToUTF8(
input.text().substr(input.parts().host.begin, input.parts().host.len)));
- const size_t registry_length =
- net::registry_controlled_domains::GetRegistryLength(
+ const bool has_registry_domain =
+ net::registry_controlled_domains::HostHasRegistryControlledDomain(
host,
net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
- return registry_length == 0 && db->IsTypedHost(host);
+ return !has_registry_domain && db->IsTypedHost(host);
}
bool HistoryURLProvider::PromoteOrCreateShorterSuggestion(

Powered by Google App Engine
This is Rietveld 408576698