Chromium Code Reviews| Index: ash/shell.cc |
| diff --git a/ash/shell.cc b/ash/shell.cc |
| index c12b790bc3bec3a4db87f3b6667ff067f839f259..141f4be315064330ef1ccaa0901257d494e4a97d 100644 |
| --- a/ash/shell.cc |
| +++ b/ash/shell.cc |
| @@ -14,7 +14,6 @@ |
| #include "ash/accelerators/magnifier_key_scroller.h" |
| #include "ash/accelerators/spoken_feedback_toggler.h" |
| #include "ash/accessibility_delegate.h" |
| -#include "ash/app_list/app_list_delegate_impl.h" |
| #include "ash/ash_constants.h" |
| #include "ash/ash_switches.h" |
| #include "ash/aura/shell_port_classic.h" |
| @@ -486,6 +485,12 @@ void Shell::UpdateAfterLoginStatusChange(LoginStatus status) { |
| } |
| } |
| +void Shell::NotifyAppListVisibilityChanged(bool shown, |
| + aura::Window* root_window) { |
| + for (auto& observer : shell_observers_) |
| + observer.OnAppListVisibilityChanged(shown, root_window); |
| +} |
| + |
| void Shell::NotifyMaximizeModeStarted() { |
| for (auto& observer : shell_observers_) |
| observer.OnMaximizeModeStarted(); |
| @@ -596,6 +601,7 @@ Shell::Shell(std::unique_ptr<ShellDelegate> shell_delegate, |
| window_tree_host_manager_.reset(new WindowTreeHostManager); |
| user_metrics_recorder_.reset(new UserMetricsRecorder); |
| } |
| + app_list()->set_delegate(this); |
| PowerStatus::Initialize(); |
| @@ -610,6 +616,8 @@ Shell::~Shell() { |
| if (config != Config::MASH) |
| user_metrics_recorder_->OnShellShuttingDown(); |
| + app_list()->set_delegate(nullptr); |
|
sky
2017/06/07 20:21:36
Document why this this is necessary. In particular
newcomer
2017/06/08 21:59:05
Done.
|
| + |
| shell_delegate_->PreShutdown(); |
| // Remove the focus from any window. This will prevent overhead and side |
| @@ -726,9 +734,6 @@ Shell::~Shell() { |
| ScreenAsh::CreateScreenForShutdown(); |
| display_configuration_controller_.reset(); |
| - // AppListDelegateImpl depends upon AppList. |
| - app_list_delegate_impl_.reset(); |
| - |
| // These members access Shell in their destructors. |
| wallpaper_controller_.reset(); |
| accessibility_delegate_.reset(); |
| @@ -836,9 +841,6 @@ void Shell::Init(const ShellInitParams& init_params) { |
| devtools_server_->AttachClient(std::move(devtools_client)); |
| } |
| - if (config == Config::MASH) |
| - app_list_delegate_impl_ = base::MakeUnique<AppListDelegateImpl>(); |
| - |
| // TODO(sky): move creation to ShellPort. |
| if (config != Config::MASH) |
| immersive_handler_factory_ = base::MakeUnique<ImmersiveHandlerFactoryAsh>(); |
| @@ -1218,6 +1220,11 @@ void Shell::OnWindowActivated( |
| root_window_for_new_windows_ = gained_active->GetRootWindow(); |
| } |
| +void Shell::OnAppListVisibilityChanged(bool visible, int64_t display_id) { |
| + NotifyAppListVisibilityChanged( |
| + visible, ShellPort::Get()->GetRootWindowForDisplayId(display_id)); |
| +} |
| + |
| void Shell::OnSessionStateChanged(session_manager::SessionState state) { |
| // Initialize the shelf when a session becomes active. It's safe to do this |
| // multiple times (e.g. initial login vs. multiprofile add session). |