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

Unified Diff: ash/mus/root_window_controller.cc

Issue 2259153002: mash: Port ash_sysui ShelfDelegateMus impl to mojo:ash. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Destroy the window manager app before tearing down MD controllers. Created 4 years, 4 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: ash/mus/root_window_controller.cc
diff --git a/ash/mus/root_window_controller.cc b/ash/mus/root_window_controller.cc
index 861316a6888fd6df36ddb73de7435823cada5e34..9f19a52713f9bdc3ad023f79e8ec34d5a958ead7 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,18 @@ void RootWindowController::CreateLayoutManagers() {
WmWindowMus* docked_container =
GetWindowByShellWindowId(kShellWindowId_DockedContainer);
- docked_container->SetLayoutManager(
- base::MakeUnique<DockedWindowLayoutManager>(docked_container));
+ std::unique_ptr<DockedWindowLayoutManager> docked_window_layout_manager =
+ base::MakeUnique<DockedWindowLayoutManager>(docked_container);
+ docked_window_layout_manager->SetShelf(wm_shelf_.get());
+ docked_window_layout_manager->AddObserver(wm_shelf_->shelf_layout_manager());
+ docked_container->SetLayoutManager(std::move(docked_window_layout_manager));
WmWindowMus* panel_container =
GetWindowByShellWindowId(kShellWindowId_PanelContainer);
- panel_container->SetLayoutManager(
- base::MakeUnique<PanelLayoutManager>(panel_container));
+ std::unique_ptr<PanelLayoutManager> panel_layout_manager =
+ base::MakeUnique<PanelLayoutManager>(panel_container);
+ panel_layout_manager->SetShelf(wm_shelf_.get());
+ panel_container->SetLayoutManager(std::move(panel_layout_manager));
}
} // namespace mus

Powered by Google App Engine
This is Rietveld 408576698