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

Unified Diff: ui/app_list/search_controller.cc

Issue 882463004: app_list: Refactor mixer groups to avoid hard-coded groups in Mixer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@applist-mixer-clamp
Patch Set: Rewrite comments. Created 5 years, 10 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
« ui/app_list/search/mixer.h ('K') | « ui/app_list/search_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/search_controller.cc
diff --git a/ui/app_list/search_controller.cc b/ui/app_list/search_controller.cc
index 66d7593c704c440f75a0ecd86450a3a9c28be4bc..74f6e1c813ef3ea67be5dbb77f328bc6f921c451 100644
--- a/ui/app_list/search_controller.cc
+++ b/ui/app_list/search_controller.cc
@@ -33,7 +33,6 @@ SearchController::SearchController(SearchBoxModel* search_box,
mixer_(new Mixer(results)),
history_(history),
is_voice_query_(false) {
- mixer_->Init();
}
SearchController::~SearchController() {
@@ -92,12 +91,16 @@ void SearchController::InvokeResultAction(SearchResult* result,
result->InvokeAction(action_index, event_flags);
}
-void SearchController::AddProvider(Mixer::GroupId group,
+size_t SearchController::AddGroup(size_t max_results, double boost) {
+ return mixer_->AddGroup(max_results, boost);
+}
+
+void SearchController::AddProvider(size_t group_id,
scoped_ptr<SearchProvider> provider) {
provider->set_result_changed_callback(base::Bind(
&SearchController::OnResultsChanged,
base::Unretained(this)));
- mixer_->AddProviderToGroup(group, provider.get());
+ mixer_->AddProviderToGroup(group_id, provider.get());
providers_.push_back(provider.release()); // Takes ownership.
}
« ui/app_list/search/mixer.h ('K') | « ui/app_list/search_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698