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

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

Issue 7321001: Changes SearchProvider to set the description of the first consecutive (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix DCHECK Created 9 years, 5 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.h ('k') | chrome/browser/autocomplete/autocomplete_edit.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete.cc
diff --git a/chrome/browser/autocomplete/autocomplete.cc b/chrome/browser/autocomplete/autocomplete.cc
index 40ad6d26fdc8f1460cc024c4eaf4e265b490de1d..ab72ec2655f1cf466bf5a063083f42279272bd72 100644
--- a/chrome/browser/autocomplete/autocomplete.cc
+++ b/chrome/browser/autocomplete/autocomplete.cc
@@ -506,6 +506,9 @@ void AutocompleteProvider::Stop() {
void AutocompleteProvider::DeleteMatch(const AutocompleteMatch& match) {
}
+void AutocompleteProvider::PostProcessResult(AutocompleteResult* result) {
+}
+
AutocompleteProvider::~AutocompleteProvider() {
Stop();
}
@@ -949,6 +952,14 @@ void AutocompleteController::UpdateResult(bool is_synchronous_pass) {
result_.CopyOldMatches(input_, last_result);
}
+ size_t start_size = result_.size();
+ for (ACProviders::const_iterator i(providers_.begin()); i != providers_.end();
+ ++i)
+ (*i)->PostProcessResult(&result_);
+ // Providers should not alter the number of matches, otherwise it's very
+ // likely the matches are no longer sorted.
+ DCHECK_EQ(start_size, result_.size());
+
bool notify_default_match = is_synchronous_pass;
if (!is_synchronous_pass) {
const bool last_default_was_valid =
« no previous file with comments | « chrome/browser/autocomplete/autocomplete.h ('k') | chrome/browser/autocomplete/autocomplete_edit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698