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 db2aaa1065b0ac936923369827b870051ea63dbf..b855aa5381586c9dce341d66b52e33c1e7b741fa 100644 |
| --- a/chrome/browser/ui/omnibox/omnibox_controller.cc |
| +++ b/chrome/browser/ui/omnibox/omnibox_controller.cc |
| @@ -39,12 +39,9 @@ namespace { |
| // |
| // 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 very first entry in the |
| -// dropdown (which can happen for non-default matches only if we're hiding a top |
| -// verbatim match) 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. |
| +// 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) { |
| if (chrome::ShouldAllowPrefetchNonDefaultMatch()) { |
| const AutocompleteResult::const_iterator prefetch_match = std::find_if( |
| @@ -53,20 +50,12 @@ const AutocompleteMatch* GetMatchToPrefetch(const AutocompleteResult& result) { |
| } |
| // If the default match should be prefetched, do that. |
| - const AutocompleteResult::const_iterator default_match( |
| - result.default_match()); |
| + const AutocompleteResult::const_iterator default_match = |
| + result.default_match(); |
|
Peter Kasting
2015/05/28 23:06:24
Nit: Not sure why the change of initializer format
dschuyler
2015/05/29 20:38:39
Groby requested (above in this CL) that it be chan
groby-ooo-7-16
2015/05/29 20:46:04
Presumably because I asked why we use the copy-cto
Peter Kasting
2015/05/29 21:10:12
We totally can. This was just intended to be a sh
groby-ooo-7-16
2015/05/29 21:11:21
auto vs. explicit in a nutshell: Use auto if the s
|
| if ((default_match != result.end()) && |
| SearchProvider::ShouldPrefetch(*default_match)) |
| return &(*default_match); |
| - // Otherwise, if the top match is a verbatim match and the very next match |
| - // is prefetchable, fetch that. |
| - if ((result.ShouldHideTopMatch() || |
| - result.TopMatchIsStandaloneVerbatimMatch()) && |
| - (result.size() > 1) && |
| - SearchProvider::ShouldPrefetch(result.match_at(1))) |
| - return &result.match_at(1); |
| - |
| return NULL; |
| } |