Index: chrome/browser/autocomplete/autocomplete_result.cc |
diff --git a/chrome/browser/autocomplete/autocomplete_result.cc b/chrome/browser/autocomplete/autocomplete_result.cc |
index 675a96c7382afad2b89cb9076a5668ffb4121e4b..f502edd53b21f5abed35da5f176c2593feaf1bf9 100644 |
--- a/chrome/browser/autocomplete/autocomplete_result.cc |
+++ b/chrome/browser/autocomplete/autocomplete_result.cc |
@@ -259,20 +259,15 @@ AutocompleteMatch* AutocompleteResult::match_at(size_t index) { |
bool AutocompleteResult::ShouldHideTopMatch() const { |
// Gate on our field trial flag. |
Peter Kasting
2013/12/17 23:47:34
Nit: Remove this comment.
kmadhusu
2013/12/18 23:26:08
Done.
|
- if (!chrome::ShouldHideTopVerbatimMatch()) |
- return false; |
+ return chrome::ShouldHideTopVerbatimMatch() && |
+ TopMatchIsVerbatimAndHasNoConsecutiveVerbatimMatches(); |
+} |
- // If we don't have a verbatim first match, show everything. |
+bool AutocompleteResult::TopMatchIsVerbatimAndHasNoConsecutiveVerbatimMatches() |
Peter Kasting
2013/12/17 23:47:34
Nit: Name this TopMatchIsStandaloneVerbatimMatch()
kmadhusu
2013/12/18 23:26:08
Done.
|
+ const { |
if (empty() || !match_at(0).IsVerbatimType()) |
return false; |
- |
- // If the verbatim first match is followed by another verbatim match, don't |
- // hide anything, lest we cause user confusion. |
- if ((size() > 1) && match_at(1).IsVerbatimType()) |
- return false; |
- |
- // Otherwise, it's safe to hide the verbatim first match. |
- return true; |
+ return !(size() > 1) || !match_at(1).IsVerbatimType(); |
Peter Kasting
2013/12/17 23:47:34
Nit: Simpler:
return !empty() && match_at(0).Is
kmadhusu
2013/12/18 23:26:08
Done.
|
} |
void AutocompleteResult::Reset() { |