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

Side by Side Diff: ash/mus/bridge/wm_shelf_mus.cc

Issue 2304443002: ash: Move ShelfWidget ownership to WmShelf and refactor access to it (Closed)
Patch Set: typo 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 unified diff | Download patch
OLDNEW
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(WmRootWindowController* root_window_controller) {
msw 2016/08/31 23:01:39 optional nit: pass in WmWindow* root_window
James Cook 2016/08/31 23:33:45 Done.
17 DCHECK(root_window_controller); 16 DCHECK(root_window_controller);
18 WmShell::Get()->CreateShelfDelegate(); 17 WmShell::Get()->CreateShelfDelegate();
19 WmWindow* root = root_window_controller->GetWindow(); 18 WmWindow* root = root_window_controller->GetWindow();
20 shelf_widget_.reset(new ShelfWidget( 19 CreateShelfWidget(root);
21 root->GetChildByShellWindowId(kShellWindowId_ShelfContainer),
22 root->GetChildByShellWindowId(kShellWindowId_StatusContainer), this));
23 InitializeShelf(); 20 InitializeShelf();
24 WmShell::Get()->NotifyShelfCreatedForRootWindow(root); 21 WmShell::Get()->NotifyShelfCreatedForRootWindow(root);
25 shelf_widget_->PostCreateShelf(); 22 shelf_widget()->PostCreateShelf();
26 } 23 }
27 24
28 WmShelfMus::~WmShelfMus() { 25 WmShelfMus::~WmShelfMus() {
29 shelf_widget_.reset(); 26 DestroyShelfWidget();
30 ShutdownShelf(); 27 ShutdownShelf();
31 } 28 }
32 29
33 void WmShelfMus::WillDeleteShelfLayoutManager() { 30 void WmShelfMus::WillDeleteShelfLayoutManager() {
34 shelf_widget_->Shutdown(); 31 ShutdownShelfWidget();
35 WmShelf::WillDeleteShelfLayoutManager(); 32 WmShelf::WillDeleteShelfLayoutManager();
36 } 33 }
37 34
38 } // namespace mus 35 } // namespace mus
39 } // namespace ash 36 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698