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

Unified Diff: ash/common/wm_root_window_controller.cc

Issue 2393083005: Moves Shell::CreateShelf() to WmShell (Closed)
Patch Set: tweak Created 4 years, 2 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/common/wm_root_window_controller.cc
diff --git a/ash/common/wm_root_window_controller.cc b/ash/common/wm_root_window_controller.cc
index 82af9b4316f653fa2db42b6bf3335168c05c8b7b..f689a556a5eaf66408533405623c0b5d451d8183 100644
--- a/ash/common/wm_root_window_controller.cc
+++ b/ash/common/wm_root_window_controller.cc
@@ -5,6 +5,7 @@
#include "ash/common/wm_root_window_controller.h"
#include "ash/common/session/session_state_delegate.h"
+#include "ash/common/shelf/shelf_layout_manager.h"
#include "ash/common/shelf/shelf_widget.h"
#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/shell_delegate.h"
@@ -192,6 +193,28 @@ WmRootWindowController::GetSystemModalLayoutManager(WmWindow* window) {
: nullptr;
}
+void WmRootWindowController::CreateShelf() {
+ WmShelf* shelf = GetShelf();
+ if (shelf->IsShelfInitialized())
+ return;
+ shelf->InitializeShelf();
+
+ if (panel_layout_manager_)
+ panel_layout_manager_->SetShelf(shelf);
+ if (docked_window_layout_manager_) {
+ docked_window_layout_manager_->SetShelf(shelf);
+ if (shelf->shelf_layout_manager())
+ docked_window_layout_manager_->AddObserver(shelf->shelf_layout_manager());
+ }
+
+ // Notify shell observers that the shelf has been created.
+ // TODO(jamescook): Move this into WmShelf::InitializeShelf(). This will
+ // require changing AttachedPanelWidgetTargeter's access to WmShelf.
+ WmShell::Get()->NotifyShelfCreatedForRootWindow(GetWindow());
+
+ shelf->shelf_widget()->PostCreateShelf();
+}
+
void WmRootWindowController::ShowShelf() {
WmShelf* shelf = GetShelf();
if (!shelf->IsShelfInitialized())

Powered by Google App Engine
This is Rietveld 408576698