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

Unified Diff: components/omnibox/autocomplete_result.cc

Issue 1155673002: Omnibox - Add About Flag to Reverse Title and URLs in the Dropdown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: peter's comments, including refactoring Created 5 years, 7 months 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
Index: components/omnibox/autocomplete_result.cc
diff --git a/components/omnibox/autocomplete_result.cc b/components/omnibox/autocomplete_result.cc
index 5d7c42c3a3ce1f0a84c7555e08d2b2ffd6febe13..ca61ba68a0b83f1ce0f23ae2dbe32b9cf8c79033 100644
--- a/components/omnibox/autocomplete_result.cc
+++ b/components/omnibox/autocomplete_result.cc
@@ -161,15 +161,17 @@ void AutocompleteResult::CopyOldMatches(
SortAndCull(input, template_url_service);
}
-void AutocompleteResult::AppendMatches(const ACMatches& matches) {
-#ifndef NDEBUG
+void AutocompleteResult::AppendMatches(const AutocompleteInput& input,
+ const ACMatches& matches) {
for (ACMatches::const_iterator i(matches.begin()); i != matches.end(); ++i) {
Peter Kasting 2015/05/22 23:39:36 Nit: Range-based for?
Mark P 2015/05/23 20:32:13 Okay. Done.
+#ifndef NDEBUG
DCHECK_EQ(AutocompleteMatch::SanitizeString(i->contents), i->contents);
DCHECK_EQ(AutocompleteMatch::SanitizeString(i->description),
i->description);
- }
#endif
- std::copy(matches.begin(), matches.end(), std::back_inserter(matches_));
+ matches_.push_back(*i);
+ matches_.back().PossiblySwapContentsAndDescriptionForURLSuggestion(input);
+ }
default_match_ = end();
alternate_nav_url_ = GURL();
}

Powered by Google App Engine
This is Rietveld 408576698