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

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: test fix 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
« no previous file with comments | « ui/app_list/search/mixer.h ('k') | ui/app_list/search_result.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..cf3fd06be5d0f87e4199617554c0cb952ec50475 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 = 6;
// 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, 3.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);
« no previous file with comments | « ui/app_list/search/mixer.h ('k') | ui/app_list/search_result.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698