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

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

Issue 683703002: Notify launcher page with onTransitionChanged event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@launcher_page_api_show_state_notify
Patch Set: nullptr like it's 1999 Created 6 years, 2 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/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 c62666cc116babbc1ed5d7f09be697a07e711aad..129e46d470f04ff0a12034b80170b8c7a8bdec20 100644
--- a/chrome/browser/ui/app_list/app_list_view_delegate.cc
+++ b/chrome/browser/ui/app_list/app_list_view_delegate.cc
@@ -453,6 +453,25 @@ void AppListViewDelegate::ViewInitialized() {
hotword_service->RequestHotwordSession(this);
}
}
+ AttachLauncherPageEventDispatcher();
+}
+
+void AppListViewDelegate::ViewReinitializedForProfileChange() {
+ AttachLauncherPageEventDispatcher();
+}
+
+void AppListViewDelegate::AttachLauncherPageEventDispatcher() {
+ std::vector<GURL> custom_launcher_page_urls;
+ GetCustomLauncherPageUrls(profile_, &custom_launcher_page_urls);
+
+ // Only the first custom launcher page gets events dispatched to it.
+ if (!custom_launcher_page_urls.empty()) {
+ chrome::HostDesktopType desktop = chrome::GetHostDesktopTypeForNativeWindow(
+ controller_->GetAppListWindow());
tapted 2014/11/03 00:31:20 (overridden by later comments, but worth noting:
calamity 2014/11/06 02:36:31 Acknowledged.
+ launcher_page_event_dispatcher_.reset(
+ new app_list::LauncherPageEventDispatcherViews(
+ desktop, profile_, custom_launcher_page_urls[0].host()));
+ }
}
void AppListViewDelegate::Dismiss() {
@@ -462,6 +481,8 @@ void AppListViewDelegate::Dismiss() {
void AppListViewDelegate::ViewClosing() {
controller_->ViewClosing();
+ launcher_page_event_dispatcher_.reset();
tapted 2014/11/03 00:31:20 This lifetime is really confusing. Why can't the e
calamity 2014/11/06 02:36:31 Done.
+
if (!profile_)
return;

Powered by Google App Engine
This is Rietveld 408576698