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

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: Init omnibox_group_ and use in-class initialization. Created 5 years, 8 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 | « 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 0b1639e2dc29208276bf253a0ef8f955d74d0104..dfdf67899426245625d089b2e781016d568e7b0b 100644
--- a/ui/app_list/search_controller.cc
+++ b/ui/app_list/search_controller.cc
@@ -35,7 +35,6 @@ SearchController::SearchController(SearchBoxModel* search_box,
mixer_(new Mixer(results)),
history_(history),
is_voice_query_(false) {
- mixer_->Init();
}
SearchController::~SearchController() {
@@ -98,12 +97,20 @@ 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);
+}
+
+size_t SearchController::AddOmniboxGroup(size_t max_results, double boost) {
+ return mixer_->AddOmniboxGroup(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.
}
« no previous file with comments | « ui/app_list/search_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698