Chromium Code Reviews| 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 |