| Index: ash/mus/root_window_controller.cc
|
| diff --git a/ash/mus/root_window_controller.cc b/ash/mus/root_window_controller.cc
|
| index 16590ec966bfd1698a3ff62887c0db70c732e236..ef95f088e9ecc75a3c9e5c60466a058dffb47ee2 100644
|
| --- a/ash/mus/root_window_controller.cc
|
| +++ b/ash/mus/root_window_controller.cc
|
| @@ -29,8 +29,8 @@
|
| #include "ash/mus/non_client_frame_controller.h"
|
| #include "ash/mus/property_util.h"
|
| #include "ash/mus/screenlock_layout.h"
|
| -#include "ash/mus/shelf_layout_manager.h"
|
| #include "ash/mus/window_manager.h"
|
| +#include "ash/shelf/shelf_layout_manager.h"
|
| #include "base/bind.h"
|
| #include "base/command_line.h"
|
| #include "base/memory/ptr_util.h"
|
| @@ -163,21 +163,6 @@ gfx::Rect RootWindowController::CalculateDefaultBounds(
|
| width, height);
|
| }
|
|
|
| -void RootWindowController::OnShelfWindowAvailable() {
|
| - DockedWindowLayoutManager* docked_window_layout_manager =
|
| - DockedWindowLayoutManager::Get(WmWindowMus::Get(root_));
|
| -
|
| - DCHECK(!docked_window_layout_manager->shelf());
|
| - docked_window_layout_manager->SetShelf(wm_shelf_.get());
|
| -
|
| - PanelLayoutManager::Get(WmWindowMus::Get(root_))->SetShelf(wm_shelf_.get());
|
| -
|
| - // TODO: http://crbug.com/614182 Ash's ShelfLayoutManager implements
|
| - // DockedWindowLayoutManagerObserver so that it can inset by the docked
|
| - // windows.
|
| - // docked_layout_manager_->AddObserver(shelf_->shelf_layout_manager());
|
| -}
|
| -
|
| void RootWindowController::CreateLayoutManagers() {
|
| // Override the default layout managers for certain containers.
|
| WmWindowMus* lock_screen_container =
|
| @@ -185,12 +170,7 @@ void RootWindowController::CreateLayoutManagers() {
|
| layout_managers_[lock_screen_container->mus_window()].reset(
|
| new ScreenlockLayout(lock_screen_container->mus_window()));
|
|
|
| - WmWindowMus* shelf_container =
|
| - GetWindowByShellWindowId(kShellWindowId_ShelfContainer);
|
| - ShelfLayoutManager* shelf_layout_manager =
|
| - new ShelfLayoutManager(shelf_container->mus_window(), this);
|
| - layout_managers_[shelf_container->mus_window()].reset(shelf_layout_manager);
|
| -
|
| + // Creating the shelf also creates the status area and both layout managers.
|
| wm_shelf_.reset(new WmShelfMus(wm_root_window_controller_.get()));
|
|
|
| WmWindowMus* default_container =
|
| @@ -203,13 +183,19 @@ void RootWindowController::CreateLayoutManagers() {
|
|
|
| WmWindowMus* docked_container =
|
| GetWindowByShellWindowId(kShellWindowId_DockedContainer);
|
| + DockedWindowLayoutManager* docked_window_layout_manager =
|
| + new DockedWindowLayoutManager(docked_container);
|
| docked_container->SetLayoutManager(
|
| - base::WrapUnique(new DockedWindowLayoutManager(docked_container)));
|
| + base::WrapUnique(docked_window_layout_manager));
|
| + docked_window_layout_manager->SetShelf(wm_shelf_.get());
|
| + docked_window_layout_manager->AddObserver(wm_shelf_->shelf_layout_manager());
|
|
|
| WmWindowMus* panel_container =
|
| GetWindowByShellWindowId(kShellWindowId_PanelContainer);
|
| - panel_container->SetLayoutManager(
|
| - base::WrapUnique(new PanelLayoutManager(panel_container)));
|
| + PanelLayoutManager* panel_layout_manager =
|
| + new PanelLayoutManager(panel_container);
|
| + panel_container->SetLayoutManager(base::WrapUnique(panel_layout_manager));
|
| + panel_layout_manager->SetShelf(wm_shelf_.get());
|
| }
|
|
|
| } // namespace mus
|
|
|