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

Unified Diff: chrome/browser/ui/app_list/search/search_controller.cc

Issue 379333005: Allow AppSearchProvider to provide recommendations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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: chrome/browser/ui/app_list/search/search_controller.cc
diff --git a/chrome/browser/ui/app_list/search/search_controller.cc b/chrome/browser/ui/app_list/search/search_controller.cc
index 86de7d01403ebfb21902570492cf3aa8bab5268f..0cbbf9e2e485a92b658bb3c4a707360c1db3080d 100644
--- a/chrome/browser/ui/app_list/search/search_controller.cc
+++ b/chrome/browser/ui/app_list/search/search_controller.cc
@@ -91,6 +91,23 @@ void SearchController::Init() {
}
}
+void SearchController::FetchRecommendations() {
+ Stop();
+
+ list_controller_->OnSearchStarted();
+
+ dispatching_query_ = true;
+ for (Providers::iterator it = providers_.begin();
+ it != providers_.end();
+ ++it) {
+ (*it)->FetchRecommendations();
+ }
+ dispatching_query_ = false;
+
+ OnResultsChanged();
+ InitiateStopTimer();
+}
+
void SearchController::Start() {
Stop();
@@ -108,7 +125,10 @@ void SearchController::Start() {
dispatching_query_ = false;
OnResultsChanged();
+ InitiateStopTimer();
+}
+void SearchController::InitiateStopTimer() {
// Maximum time (in milliseconds) to wait to the search providers to finish.
const int kStopTimeMS = 1500;
Matt Giuca 2014/07/22 04:31:07 nit: This constant should be more visible -- at le
calamity 2014/07/22 07:24:04 Done.
stop_timer_.Start(FROM_HERE,

Powered by Google App Engine
This is Rietveld 408576698