| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/mus/bridge/wm_shelf_mus.h" | 5 #include "ash/mus/bridge/wm_shelf_mus.h" |
| 6 | 6 |
| 7 #include "ash/common/shelf/shelf_widget.h" | 7 #include "ash/common/shelf/shelf_widget.h" |
| 8 #include "ash/common/shell_window_ids.h" | |
| 9 #include "ash/common/wm_root_window_controller.h" | 8 #include "ash/common/wm_root_window_controller.h" |
| 10 #include "ash/common/wm_shell.h" | 9 #include "ash/common/wm_shell.h" |
| 11 #include "ash/common/wm_window.h" | 10 #include "ash/common/wm_window.h" |
| 12 | 11 |
| 13 namespace ash { | 12 namespace ash { |
| 14 namespace mus { | 13 namespace mus { |
| 15 | 14 |
| 16 WmShelfMus::WmShelfMus(WmRootWindowController* root_window_controller) { | 15 WmShelfMus::WmShelfMus(WmWindow* root_window) { |
| 17 DCHECK(root_window_controller); | 16 DCHECK(root_window); |
| 18 WmShell::Get()->CreateShelfDelegate(); | 17 WmShell::Get()->CreateShelfDelegate(); |
| 19 WmWindow* root = root_window_controller->GetWindow(); | 18 CreateShelfWidget(root_window); |
| 20 shelf_widget_.reset(new ShelfWidget( | |
| 21 root->GetChildByShellWindowId(kShellWindowId_ShelfContainer), | |
| 22 root->GetChildByShellWindowId(kShellWindowId_StatusContainer), this)); | |
| 23 InitializeShelf(); | 19 InitializeShelf(); |
| 24 WmShell::Get()->NotifyShelfCreatedForRootWindow(root); | 20 WmShell::Get()->NotifyShelfCreatedForRootWindow(root_window); |
| 25 shelf_widget_->PostCreateShelf(); | 21 shelf_widget()->PostCreateShelf(); |
| 26 } | 22 } |
| 27 | 23 |
| 28 WmShelfMus::~WmShelfMus() { | 24 WmShelfMus::~WmShelfMus() { |
| 29 shelf_widget_.reset(); | 25 DestroyShelfWidget(); |
| 30 ShutdownShelf(); | 26 ShutdownShelf(); |
| 31 } | 27 } |
| 32 | 28 |
| 33 void WmShelfMus::WillDeleteShelfLayoutManager() { | 29 void WmShelfMus::WillDeleteShelfLayoutManager() { |
| 34 shelf_widget_->Shutdown(); | 30 ShutdownShelfWidget(); |
| 35 WmShelf::WillDeleteShelfLayoutManager(); | 31 WmShelf::WillDeleteShelfLayoutManager(); |
| 36 } | 32 } |
| 37 | 33 |
| 38 } // namespace mus | 34 } // namespace mus |
| 39 } // namespace ash | 35 } // namespace ash |
| OLD | NEW |