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

Unified Diff: chrome/browser/ui/app_list/app_list_view_delegate.cc

Issue 55433002: Propagates the search result of start page to the app-list search box. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: observer Created 7 years, 1 month 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/app_list_view_delegate.cc
diff --git a/chrome/browser/ui/app_list/app_list_view_delegate.cc b/chrome/browser/ui/app_list/app_list_view_delegate.cc
index 6995f58468643b0bed4e5c3b74be6c3e24b52d3e..b4152b5613d30a1913e58727ba8b729070d34b51 100644
--- a/chrome/browser/ui/app_list/app_list_view_delegate.cc
+++ b/chrome/browser/ui/app_list/app_list_view_delegate.cc
@@ -86,9 +86,17 @@ AppListViewDelegate::AppListViewDelegate(
CHECK(controller_);
RegisterForNotifications();
g_browser_process->profile_manager()->GetProfileInfoCache().AddObserver(this);
+ app_list::StartPageService* service =
+ app_list::StartPageService::Get(profile_);
+ if (service)
+ service->AddObserver(this);
}
AppListViewDelegate::~AppListViewDelegate() {
+ app_list::StartPageService* service =
+ app_list::StartPageService::Get(profile_);
+ if (service)
+ service->RemoveObserver(this);
g_browser_process->
profile_manager()->GetProfileInfoCache().RemoveObserver(this);
}
@@ -266,6 +274,10 @@ void AppListViewDelegate::ShowForProfileByPath(
controller_->ShowForProfileByPath(profile_path);
}
+void AppListViewDelegate::OnSearch(const base::string16& query) {
+ model_->search_box()->SetText(query);
+}
+
void AppListViewDelegate::Observe(
int type,
const content::NotificationSource& source,

Powered by Google App Engine
This is Rietveld 408576698