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

Unified Diff: ash/mus/root_window_controller.cc

Issue 2350953009: Centralizes more shared code between ash and mash (Closed)
Patch Set: feedback Created 4 years, 3 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
« no previous file with comments | « ash/mus/root_window_controller.h ('k') | ash/mus/test/wm_test_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/root_window_controller.cc
diff --git a/ash/mus/root_window_controller.cc b/ash/mus/root_window_controller.cc
index f9584af0e17b02428c77c52f56eab04970270d7f..c0ebce22f45a09aec54082ba165ba7a090786c10 100644
--- a/ash/mus/root_window_controller.cc
+++ b/ash/mus/root_window_controller.cc
@@ -15,7 +15,6 @@
#include "ash/common/shelf/shelf_layout_manager.h"
#include "ash/common/shell_window_ids.h"
-#include "ash/common/wm/always_on_top_controller.h"
#include "ash/common/wm/container_finder.h"
#include "ash/common/wm/dock/docked_window_layout_manager.h"
#include "ash/common/wm/panels/panel_layout_manager.h"
@@ -72,15 +71,17 @@ RootWindowController::RootWindowController(WindowManager* window_manager,
window_manager_->window_manager_client()->AddActivationParent(
GetWindowByShellWindowId(kActivatableShellWindowIds[i])->mus_window());
}
-
- WmWindowMus* always_on_top_container =
- GetWindowByShellWindowId(kShellWindowId_AlwaysOnTopContainer);
- always_on_top_controller_.reset(
- new AlwaysOnTopController(always_on_top_container));
}
RootWindowController::~RootWindowController() {
- wm_root_window_controller_->DeleteWorkspaceController();
+ Shutdown();
+ root_->Destroy();
+}
+
+void RootWindowController::Shutdown() {
+ // NOTE: Shutdown() may be called multiple times.
+ wm_root_window_controller_->ResetRootForNewWindowsIfNecessary();
+ wm_root_window_controller_->CloseChildWindows();
}
shell::Connector* RootWindowController::GetConnector() {
@@ -179,21 +180,6 @@ void RootWindowController::CreateLayoutManagers() {
workspace_layout_manager_ = new WorkspaceLayoutManager(default_container);
default_container->SetLayoutManager(
base::WrapUnique(workspace_layout_manager_));
-
- WmWindowMus* docked_container =
- GetWindowByShellWindowId(kShellWindowId_DockedContainer);
- 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);
- 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
« no previous file with comments | « ash/mus/root_window_controller.h ('k') | ash/mus/test/wm_test_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698