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

Unified Diff: chrome/browser/ui/omnibox/chrome_omnibox_client.cc

Issue 2196393006: Remove search::ShouldAllowPrefetchNonDefaultMatch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_prerender_omnibox
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | components/search/search.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/omnibox/chrome_omnibox_client.cc
diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_client.cc b/chrome/browser/ui/omnibox/chrome_omnibox_client.cc
index 0444a0ac5bd3ff56714ae59c535cecca4e6b015a..115a107a0e25e19131a74b3f038d653231b532b6 100644
--- a/chrome/browser/ui/omnibox/chrome_omnibox_client.cc
+++ b/chrome/browser/ui/omnibox/chrome_omnibox_client.cc
@@ -60,22 +60,13 @@ namespace {
//
// The SearchProvider may mark some suggestions to be prefetched based on
// instructions from the suggest server. If such a match ranks sufficiently
-// highly or if kAllowPrefetchNonDefaultMatch field trial is enabled, we'll
-// return it.
+// highly, we'll return it.
//
-// If the kAllowPrefetchNonDefaultMatch field trial is enabled we return the
-// prefetch suggestion even if it is not the default match. Otherwise we only
-// care about matches that are the default or the second entry in the dropdown
-// (which can happen for non-default matches when a top verbatim match is
-// shown); for other matches, we think the likelihood of the user selecting
+// We only care about matches that are the default or the second entry in the
+// dropdown (which can happen for non-default matches when a top verbatim match
+// is shown); for other matches, we think the likelihood of the user selecting
// them is low enough that prefetching isn't worth doing.
const AutocompleteMatch* GetMatchToPrefetch(const AutocompleteResult& result) {
- if (search::ShouldAllowPrefetchNonDefaultMatch()) {
- const AutocompleteResult::const_iterator prefetch_match = std::find_if(
- result.begin(), result.end(), SearchProvider::ShouldPrefetch);
- return prefetch_match != result.end() ? &(*prefetch_match) : NULL;
- }
-
// If the default match should be prefetched, do that.
const auto default_match = result.default_match();
if ((default_match != result.end()) &&
@@ -274,8 +265,7 @@ void ChromeOmniboxClient::OnResultChanged(
bool default_match_changed,
const base::Callback<void(const SkBitmap& bitmap)>& on_bitmap_fetched) {
if (search::IsInstantExtendedAPIEnabled() &&
- ((default_match_changed && result.default_match() != result.end()) ||
- (search::ShouldAllowPrefetchNonDefaultMatch() && !result.empty()))) {
+ (default_match_changed && result.default_match() != result.end())) {
InstantSuggestion prefetch_suggestion;
const AutocompleteMatch* match_to_prefetch = GetMatchToPrefetch(result);
if (match_to_prefetch) {
« no previous file with comments | « no previous file | components/search/search.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698