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

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

Issue 2451353002: 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_quick_provider.cc
diff --git a/components/omnibox/browser/history_quick_provider.cc b/components/omnibox/browser/history_quick_provider.cc
index eeab8c16886261eaeb169b2c85a87920fec88657..ea045ad37532f8057b98549775281066ed7d24d5 100644
--- a/components/omnibox/browser/history_quick_provider.cc
+++ b/components/omnibox/browser/history_quick_provider.cc
@@ -141,19 +141,18 @@ void HistoryQuickProvider::DoAutocomplete() {
!autocomplete_input_.parts().ref.is_nonempty()) {
// Not visited, but we've seen the host before.
will_have_url_what_you_typed_match_first = true;
- const size_t registry_length =
- net::registry_controlled_domains::GetRegistryLength(
+ if (net::registry_controlled_domains::HostHasRegistryControlledDomain(
host,
net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
- net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
- if (registry_length == 0) {
- // Known intranet hosts get one score.
+ net::registry_controlled_domains::
+ EXCLUDE_PRIVATE_REGISTRIES)) {
+ // Known internet host.
url_what_you_typed_match_score =
- HistoryURLProvider::kScoreForUnvisitedIntranetResult;
+ HistoryURLProvider::kScoreForWhatYouTypedResult;
} else {
- // Known internet hosts get another.
+ // An intranet host.
url_what_you_typed_match_score =
- HistoryURLProvider::kScoreForWhatYouTypedResult;
+ HistoryURLProvider::kScoreForUnvisitedIntranetResult;
}
}
}
« no previous file with comments | « components/omnibox/browser/autocomplete_input.cc ('k') | components/omnibox/browser/history_url_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698