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

Unified Diff: ui/app_list/search_controller.cc

Issue 2225073002: [Chrome OS] Change layout of the launcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase & scale the Google Doodle image when it's too large. 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
« no previous file with comments | « ui/app_list/search_controller.h ('k') | ui/app_list/views/all_apps_tile_item_view.h » ('j') | 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 5891341544cf885ddc0f038d7ecb2785ee7fab3d..64ea6b355d9bd4afb6b8b45954330ee1269c8602 100644
--- a/ui/app_list/search_controller.cc
+++ b/ui/app_list/search_controller.cc
@@ -31,12 +31,7 @@ namespace app_list {
SearchController::SearchController(SearchBoxModel* search_box,
AppListModel::SearchResults* results,
History* history)
- : search_box_(search_box),
- dispatching_query_(false),
- mixer_(new Mixer(results)),
- history_(history),
- is_voice_query_(false) {
-}
+ : search_box_(search_box), mixer_(new Mixer(results)), history_(history) {}
SearchController::~SearchController() {
}
@@ -54,6 +49,7 @@ void SearchController::Start(bool is_voice_query) {
(*it)->Start(is_voice_query, query);
}
dispatching_query_ = false;
+ query_for_recommendation_ = query.empty() ? true : false;
is_voice_query_ = is_voice_query;
@@ -118,9 +114,8 @@ size_t SearchController::AddGroup(size_t max_results, double multiplier) {
void SearchController::AddProvider(size_t group_id,
std::unique_ptr<SearchProvider> provider) {
- provider->set_result_changed_callback(base::Bind(
- &SearchController::OnResultsChanged,
- base::Unretained(this)));
+ provider->set_result_changed_callback(
+ base::Bind(&SearchController::OnResultsChanged, base::Unretained(this)));
mixer_->AddProviderToGroup(group_id, provider.get());
providers_.push_back(std::move(provider));
}
@@ -135,7 +130,9 @@ void SearchController::OnResultsChanged() {
->swap(known_results);
}
- mixer_->MixAndPublish(is_voice_query_, known_results);
+ size_t num_max_results =
+ query_for_recommendation_ ? kNumStartPageTiles : kMaxSearchResults;
+ mixer_->MixAndPublish(is_voice_query_, known_results, num_max_results);
}
} // namespace app_list
« no previous file with comments | « ui/app_list/search_controller.h ('k') | ui/app_list/views/all_apps_tile_item_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698