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

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

Issue 69703002: Modified GetMatchToPrefetch() to return a valid match for prefetching even when hide_verbatim flag i (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/omnibox/omnibox_controller.cc
diff --git a/chrome/browser/ui/omnibox/omnibox_controller.cc b/chrome/browser/ui/omnibox/omnibox_controller.cc
index 9af3a20a54d1f8d8b4580a253f448d999ce48cae..0e64fe1852a32467a10e3259a74e2afca2a226cc 100644
--- a/chrome/browser/ui/omnibox/omnibox_controller.cc
+++ b/chrome/browser/ui/omnibox/omnibox_controller.cc
@@ -31,23 +31,15 @@ namespace {
//
// The SearchProvider may mark some suggestions to be prefetched based on
// instructions from the suggest server. If such a match ranks sufficiently
-// highly, we'll return it. We only care about matches that are the default or
-// else the very first entry in the dropdown (which can happen for non-default
-// matches only if we're hiding a top verbatim match); for other matches, we
-// think the likelihood of the user selecting them is low enough that
-// prefetching isn't worth doing.
+// highly, we'll return it. We only care about matches that are the default; 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) {
const AutocompleteResult::const_iterator default_match(
result.default_match());
- if (default_match == result.end())
- return NULL;
-
- if (SearchProvider::ShouldPrefetch(*default_match))
- return &(*default_match);
-
- return (result.ShouldHideTopMatch() && (result.size() > 1) &&
- SearchProvider::ShouldPrefetch(result.match_at(1))) ?
- &result.match_at(1) : NULL;
+ return ((default_match != result.end()) &&
samarth 2013/11/14 16:17:45 This isn't quite right. Let's say we have the fol
kmadhusu 2013/12/12 01:04:01 Fixed. Added a new function in AutocompleteResult.
+ SearchProvider::ShouldPrefetch(*default_match)) ? &(*default_match) :
+ NULL;
}
} // namespace
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698