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()) |