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

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: 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
« no previous file with comments | « ui/app_list/search_controller.h ('k') | ui/app_list/views/start_page_view.cc » ('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..e6a0c79a41217e29a5a9c910a933f2d95f74a40e 100644
--- a/ui/app_list/search_controller.cc
+++ b/ui/app_list/search_controller.cc
@@ -33,10 +33,10 @@ SearchController::SearchController(SearchBoxModel* search_box,
History* history)
: search_box_(search_box),
dispatching_query_(false),
+ query_for_recommendation_(false),
xiyuan 2016/08/09 20:22:13 nit: init |query_for_recommendation_| and |is_voic
xdai1 2016/08/09 20:33:06 Done.
xiyuan 2016/08/09 20:34:33 You might forget to include latest header file in
mixer_(new Mixer(results)),
history_(history),
- is_voice_query_(false) {
-}
+ is_voice_query_(false) {}
SearchController::~SearchController() {
}
@@ -54,6 +54,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 +119,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 +135,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/start_page_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698