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

Unified Diff: chrome/browser/autocomplete/autocomplete_result.cc

Issue 329783003: Omnibox: append old matches, don't attempt to insert them (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_result.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_result.cc
diff --git a/chrome/browser/autocomplete/autocomplete_result.cc b/chrome/browser/autocomplete/autocomplete_result.cc
index 67da012239156bba5fd240efc6f6d0987e9f8822..cc8c66f7aa21d66830fa0c421ff4417002ab5b2d 100644
--- a/chrome/browser/autocomplete/autocomplete_result.cc
+++ b/chrome/browser/autocomplete/autocomplete_result.cc
@@ -406,23 +406,6 @@ void AutocompleteResult::CopyFrom(const AutocompleteResult& rhs) {
alternate_nav_url_ = rhs.alternate_nav_url_;
}
-void AutocompleteResult::AddMatch(
- AutocompleteInput::PageClassification page_classification,
- const AutocompleteMatch& match) {
- DCHECK(default_match_ != end());
- DCHECK_EQ(AutocompleteMatch::SanitizeString(match.contents), match.contents);
- DCHECK_EQ(AutocompleteMatch::SanitizeString(match.description),
- match.description);
- CompareWithDemoteByType comparing_object(page_classification);
- ACMatches::iterator insertion_point =
- std::upper_bound(begin(), end(), match, comparing_object);
- matches_difference_type default_offset = default_match_ - begin();
- if ((insertion_point - begin()) <= default_offset)
- ++default_offset;
- matches_.insert(insertion_point, match);
- default_match_ = begin() + default_offset;
-}
-
void AutocompleteResult::BuildProviderToMatches(
ProviderToMatches* provider_to_matches) const {
for (ACMatches::const_iterator i(begin()); i != end(); ++i)
@@ -461,7 +444,11 @@ void AutocompleteResult::MergeMatchesByProvider(
AutocompleteMatch match = *i;
match.relevance = std::min(max_relevance, match.relevance);
match.from_previous = true;
- AddMatch(page_classification, match);
+ DCHECK_EQ(AutocompleteMatch::SanitizeString(match.contents),
+ match.contents);
+ DCHECK_EQ(AutocompleteMatch::SanitizeString(match.description),
+ match.description);
Peter Kasting 2014/06/11 20:06:43 I don't think these two DCHECKs are necessary. We
Mark P 2014/06/11 21:40:44 Done.
+ matches_.push_back(match);
delta--;
}
}
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_result.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698