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

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

Issue 2456643005: Reduce buggy usage of the registry controlled domain service. (Closed)
Patch Set: Fix 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 4d19ac012000ef08063e7d0092c1de1bc63ec955..433c8d1c9a54fd4839979df031aafc9f92d66bfe 100644
--- a/components/omnibox/browser/history_url_provider.cc
+++ b/components/omnibox/browser/history_url_provider.cc
@@ -982,12 +982,11 @@ 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(
- host,
- net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
+ 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(
« no previous file with comments | « components/omnibox/browser/history_quick_provider.cc ('k') | components/search_engines/template_url_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698