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

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: Add EnumTraits for shelf alignment and auto-hide behavior. 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 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

Powered by Google App Engine
This is Rietveld 408576698