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

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

Issue 2225073002: [Chrome OS] Change layout of the launcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address xiyuan@'s comments. Created 4 years, 4 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
Index: ui/app_list/search/mixer.cc
diff --git a/ui/app_list/search/mixer.cc b/ui/app_list/search/mixer.cc
index f5b7e998d1a5d4adee4245ced1101207a3db8df6..66560c7f3c69361bb2e80d9eb35e36d17051e004 100644
--- a/ui/app_list/search/mixer.cc
+++ b/ui/app_list/search/mixer.cc
@@ -18,9 +18,6 @@ namespace app_list {
namespace {
-// Maximum number of results to show.
-const size_t kMinResults = 6;
-
void UpdateResult(const SearchResult& source, SearchResult* target) {
target->set_display_type(source.display_type());
target->set_title(source.title());
@@ -138,11 +135,12 @@ void Mixer::AddProviderToGroup(size_t group_id, SearchProvider* provider) {
}
void Mixer::MixAndPublish(bool is_voice_query,
- const KnownResults& known_results) {
+ const KnownResults& known_results,
+ size_t num_max_results) {
FetchResults(is_voice_query, known_results);
SortedResults results;
- results.reserve(kMinResults);
+ results.reserve(num_max_results);
// Add results from each group. Limit to the maximum number of results in each
// group.
@@ -159,7 +157,7 @@ void Mixer::MixAndPublish(bool is_voice_query,
RemoveDuplicates(&results);
std::sort(results.begin(), results.end());
- if (results.size() < kMinResults) {
+ if (results.size() < num_max_results) {
size_t original_size = results.size();
// We didn't get enough results. Insert all the results again, and this
// time, do not limit the maximum number of results from each group. (This

Powered by Google App Engine
This is Rietveld 408576698