| Index: ash/root_window_controller.cc
|
| diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
|
| index e9d7a93977e2f9158f27fdf47b230cb5ee4a3032..ed933609b43bce42fd7c190b599a4a492af24cf6 100644
|
| --- a/ash/root_window_controller.cc
|
| +++ b/ash/root_window_controller.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "ash/root_window_controller.h"
|
|
|
| +#include <algorithm>
|
| #include <queue>
|
| #include <vector>
|
|
|
| @@ -271,6 +272,10 @@ bool ShouldDestroyWindowInCloseChildWindows(WmWindow* window) {
|
|
|
| } // namespace
|
|
|
| +// static
|
| +std::vector<RootWindowController*>*
|
| + RootWindowController::root_window_controllers_ = nullptr;
|
| +
|
| RootWindowController::~RootWindowController() {
|
| Shutdown();
|
| ash_host_.reset();
|
| @@ -280,6 +285,9 @@ RootWindowController::~RootWindowController() {
|
| capture_client_.reset();
|
| if (animating_wallpaper_widget_controller_.get())
|
| animating_wallpaper_widget_controller_->StopAnimating();
|
| + root_window_controllers_->erase(std::find(root_window_controllers_->begin(),
|
| + root_window_controllers_->end(),
|
| + this));
|
| }
|
|
|
| void RootWindowController::CreateForPrimaryDisplay(AshWindowTreeHost* host) {
|
| @@ -748,6 +756,11 @@ RootWindowController::RootWindowController(
|
| : window_tree_host),
|
| wm_shelf_(base::MakeUnique<WmShelf>()) {
|
| DCHECK((ash_host && !window_tree_host) || (!ash_host && window_tree_host));
|
| +
|
| + if (!root_window_controllers_)
|
| + root_window_controllers_ = new std::vector<RootWindowController*>;
|
| + root_window_controllers_->push_back(this);
|
| +
|
| aura::Window* root_window = GetRootWindow();
|
| GetRootWindowSettings(root_window)->controller = this;
|
|
|
| @@ -760,11 +773,8 @@ RootWindowController::RootWindowController(
|
| void RootWindowController::Init(RootWindowType root_window_type) {
|
| aura::Window* root_window = GetRootWindow();
|
| WmShell* wm_shell = WmShell::Get();
|
| - Shell* shell = nullptr;
|
| - if (!wm_shell->IsRunningInMash()) {
|
| - shell = Shell::GetInstance();
|
| - shell->InitRootWindow(root_window);
|
| - }
|
| + Shell* shell = Shell::GetInstance();
|
| + shell->InitRootWindow(root_window);
|
|
|
| CreateContainers();
|
|
|
| @@ -793,8 +803,7 @@ void RootWindowController::Init(RootWindowType root_window_type) {
|
| CreateShelf();
|
|
|
| // Notify shell observers about new root window.
|
| - if (!wm_shell->IsRunningInMash())
|
| - shell->OnRootWindowAdded(WmWindow::Get(root_window));
|
| + shell->OnRootWindowAdded(WmWindow::Get(root_window));
|
| }
|
|
|
| // TODO: AshTouchExplorationManager doesn't work with mus.
|
|
|