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

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: addressed comments 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..62ad226a63daf2c54db3e960702aeb98961bb7c1 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;
@@ -123,6 +124,7 @@ Mixer::~Mixer() {
}
void Mixer::Init() {
+ groups_[SUGGESTIONS_GROUP].reset(new Group(kMaxSuggestionsResults, 3.0));
huangs 2014/12/10 07:14:04 NIT: add this one last, to preserve GroupId orderi
Mathieu 2014/12/10 16:01:29 Done.
groups_[MAIN_GROUP].reset(new Group(kMaxMainGroupResults, 3.0));
groups_[OMNIBOX_GROUP].reset(new Group(kNoMaxResultsLimit, 2.0));
groups_[WEBSTORE_GROUP].reset(new Group(kMaxWebstoreResults, 1.0));
@@ -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