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

Unified Diff: ui/app_list/search/mixer.cc

Issue 775893005: [AppList] Add a Suggestions Provider to applist. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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: ui/app_list/search/mixer.cc
diff --git a/ui/app_list/search/mixer.cc b/ui/app_list/search/mixer.cc
index e9b0f1b747302172b524a8a09ecaf1d465512b9b..24f13f93b64cddb7f360d44ff503a206ee3d0ab5 100644
--- a/ui/app_list/search/mixer.cc
+++ b/ui/app_list/search/mixer.cc
@@ -22,6 +22,7 @@ const size_t kMaxResults = 6;
const size_t kMaxMainGroupResults = 4;
const size_t kMaxWebstoreResults = 2;
const size_t kMaxPeopleResults = 2;
+const size_t kMaxSuggestionsResults = 4;
Mathieu 2014/12/03 21:01:31 App launcher folks: I'm not sure any of this is ne
// A value to indicate no max number of results limit.
const size_t kNoMaxResultsLimit = 0;
@@ -127,6 +128,7 @@ void Mixer::Init() {
groups_[OMNIBOX_GROUP].reset(new Group(kNoMaxResultsLimit, 2.0));
groups_[WEBSTORE_GROUP].reset(new Group(kMaxWebstoreResults, 1.0));
groups_[PEOPLE_GROUP].reset(new Group(kMaxPeopleResults, 0.0));
+ groups_[SUGGESTIONS_GROUP].reset(new Group(kMaxSuggestionsResults, 2.0));
}
void Mixer::AddProviderToGroup(GroupId group, SearchProvider* provider) {
@@ -143,6 +145,7 @@ void Mixer::MixAndPublish(const KnownResults& known_results) {
const Group& omnibox_group = *groups_[OMNIBOX_GROUP];
const Group& webstore_group = *groups_[WEBSTORE_GROUP];
const Group& people_group = *groups_[PEOPLE_GROUP];
+ const Group& suggestions_group = *groups_[SUGGESTIONS_GROUP];
// Adds main group and web store results first.
results.insert(results.end(), main_group.results().begin(),
@@ -151,6 +154,8 @@ void Mixer::MixAndPublish(const KnownResults& known_results) {
webstore_group.results().end());
results.insert(results.end(), people_group.results().begin(),
people_group.results().end());
+ results.insert(results.end(), suggestions_group.results().begin(),
+ suggestions_group.results().end());
// Collapse duplicate apps from local and web store.
RemoveDuplicates(&results);

Powered by Google App Engine
This is Rietveld 408576698