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..4bd8d321f58642a3b55fc90e311f1162aa4817a5 100644 |
--- a/chrome/browser/autocomplete/autocomplete_result.cc |
+++ b/chrome/browser/autocomplete/autocomplete_result.cc |
@@ -259,20 +259,18 @@ AutocompleteMatch* AutocompleteResult::match_at(size_t index) { |
bool AutocompleteResult::ShouldHideTopMatch() const { |
// Gate on our field trial flag. |
- if (!chrome::ShouldHideTopVerbatimMatch()) |
- return false; |
+ return chrome::ShouldHideTopVerbatimMatch() && |
+ TopMatchIsVerbatimAndHasNoConsecutiveVerbatimMatches(); |
+} |
- // If we don't have a verbatim first match, show everything. |
+bool AutocompleteResult::TopMatchIsVerbatimAndHasNoConsecutiveVerbatimMatches() |
+ 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; |
+ // If the verbatim first match is followed by another verbatim match, return |
+ // false to avoid user confusion. |
Mark P
2013/12/12 23:13:07
This user confusion comment doesn't make sense any
kmadhusu
2013/12/13 01:00:29
Done. Removed the comment.
|
+ return !(size() > 1) || !match_at(1).IsVerbatimType(); |
} |
void AutocompleteResult::Reset() { |