| 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.h" | 7 #include "ash/common/shelf/shelf.h" | 
| 8 #include "ash/common/shelf/shelf_delegate.h" | 8 #include "ash/common/shelf/shelf_delegate.h" | 
| 9 #include "ash/common/shelf/shelf_widget.h" | 9 #include "ash/common/shelf/shelf_widget.h" | 
| 10 #include "ash/common/shell_window_ids.h" | 10 #include "ash/common/shell_window_ids.h" | 
| (...skipping 10 matching lines...) Expand all  Loading... | 
| 21   WmWindow* root = root_window_controller->GetWindow(); | 21   WmWindow* root = root_window_controller->GetWindow(); | 
| 22   shelf_widget_.reset(new ShelfWidget( | 22   shelf_widget_.reset(new ShelfWidget( | 
| 23       root->GetChildByShellWindowId(kShellWindowId_ShelfContainer), | 23       root->GetChildByShellWindowId(kShellWindowId_ShelfContainer), | 
| 24       root->GetChildByShellWindowId(kShellWindowId_StatusContainer), this)); | 24       root->GetChildByShellWindowId(kShellWindowId_StatusContainer), this)); | 
| 25   shelf_.reset( | 25   shelf_.reset( | 
| 26       new Shelf(this, shelf_widget_->CreateShelfView(), shelf_widget_.get())); | 26       new Shelf(this, shelf_widget_->CreateShelfView(), shelf_widget_.get())); | 
| 27   shelf_widget_->set_shelf(shelf_.get()); | 27   shelf_widget_->set_shelf(shelf_.get()); | 
| 28   // Must be initialized before the delegate is notified because the delegate | 28   // Must be initialized before the delegate is notified because the delegate | 
| 29   // may try to access the WmShelf. | 29   // may try to access the WmShelf. | 
| 30   SetShelf(shelf_.get()); | 30   SetShelf(shelf_.get()); | 
| 31   WmShell::Get()->shelf_delegate()->OnShelfCreated(shelf_.get()); | 31   WmShell::Get()->shelf_delegate()->OnShelfCreated(this); | 
| 32   WmShell::Get()->NotifyShelfCreatedForRootWindow(root); | 32   WmShell::Get()->NotifyShelfCreatedForRootWindow(root); | 
| 33   shelf_widget_->PostCreateShelf(); | 33   shelf_widget_->PostCreateShelf(); | 
| 34 } | 34 } | 
| 35 | 35 | 
| 36 WmShelfMus::~WmShelfMus() { | 36 WmShelfMus::~WmShelfMus() { | 
| 37   shelf_widget_.reset(); | 37   shelf_widget_.reset(); | 
| 38   WmShelf::ClearShelf(); | 38   WmShelf::ClearShelf(); | 
| 39 } | 39 } | 
| 40 | 40 | 
| 41 void WmShelfMus::WillDeleteShelfLayoutManager() { | 41 void WmShelfMus::WillDeleteShelfLayoutManager() { | 
| 42   shelf_widget_->Shutdown(); | 42   shelf_widget_->Shutdown(); | 
| 43   WmShelf::WillDeleteShelfLayoutManager(); | 43   WmShelf::WillDeleteShelfLayoutManager(); | 
| 44 } | 44 } | 
| 45 | 45 | 
| 46 }  // namespace mus | 46 }  // namespace mus | 
| 47 }  // namespace ash | 47 }  // namespace ash | 
| OLD | NEW | 
|---|