Chromium Code Reviews| 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; |