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

Unified Diff: ui/app_list/search_controller.cc

Issue 2253253002: [Merge to M53][Chrome OS] Change layout of the launcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: 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 c72080e6ca9d0fbec55eb5cdbb37ff20fd464275..9ad28769cbc5d18ad774772907746d784ab1d4e7 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;
@@ -126,9 +122,8 @@ size_t SearchController::AddOmniboxGroup(size_t max_results,
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));
}
@@ -143,7 +138,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