| 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/common/wm_root_window_controller.h" | 5 #include "ash/common/wm_root_window_controller.h" |
| 6 | 6 |
| 7 #include "ash/aura/wm_window_aura.h" | 7 #include "ash/aura/wm_window_aura.h" |
| 8 #include "ash/common/session/session_state_delegate.h" | 8 #include "ash/common/session/session_state_delegate.h" |
| 9 #include "ash/common/shelf/shelf_layout_manager.h" | 9 #include "ash/common/shelf/shelf_layout_manager.h" |
| 10 #include "ash/common/shelf/shelf_widget.h" | 10 #include "ash/common/shelf/shelf_widget.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 } | 214 } |
| 215 | 215 |
| 216 // Notify shell observers that the shelf has been created. | 216 // Notify shell observers that the shelf has been created. |
| 217 // TODO(jamescook): Move this into WmShelf::InitializeShelf(). This will | 217 // TODO(jamescook): Move this into WmShelf::InitializeShelf(). This will |
| 218 // require changing AttachedPanelWidgetTargeter's access to WmShelf. | 218 // require changing AttachedPanelWidgetTargeter's access to WmShelf. |
| 219 WmShell::Get()->NotifyShelfCreatedForRootWindow(GetWindow()); | 219 WmShell::Get()->NotifyShelfCreatedForRootWindow(GetWindow()); |
| 220 | 220 |
| 221 shelf->shelf_widget()->PostCreateShelf(); | 221 shelf->shelf_widget()->PostCreateShelf(); |
| 222 } | 222 } |
| 223 | 223 |
| 224 void WmRootWindowController::ShowShelf() { | |
| 225 WmShelf* shelf = GetShelf(); | |
| 226 if (!shelf->IsShelfInitialized()) | |
| 227 return; | |
| 228 // TODO(jamescook): Move this into WmShelf. | |
| 229 shelf->shelf_widget()->SetShelfVisibility(true); | |
| 230 shelf->shelf_widget()->status_area_widget()->Show(); | |
| 231 } | |
| 232 | |
| 233 SystemTray* WmRootWindowController::GetSystemTray() { | 224 SystemTray* WmRootWindowController::GetSystemTray() { |
| 234 ShelfWidget* shelf_widget = GetShelf()->shelf_widget(); | 225 ShelfWidget* shelf_widget = GetShelf()->shelf_widget(); |
| 235 if (!shelf_widget || !shelf_widget->status_area_widget()) | 226 if (!shelf_widget || !shelf_widget->status_area_widget()) |
| 236 return nullptr; | 227 return nullptr; |
| 237 return shelf_widget->status_area_widget()->system_tray(); | 228 return shelf_widget->status_area_widget()->system_tray(); |
| 238 } | 229 } |
| 239 | 230 |
| 240 WmWindow* WmRootWindowController::GetContainer(int container_id) { | 231 WmWindow* WmRootWindowController::GetContainer(int container_id) { |
| 241 return root_->GetChildByShellWindowId(container_id); | 232 return root_->GetChildByShellWindowId(container_id); |
| 242 } | 233 } |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 } | 618 } |
| 628 | 619 |
| 629 void WmRootWindowController::OnMenuClosed() { | 620 void WmRootWindowController::OnMenuClosed() { |
| 630 menu_runner_.reset(); | 621 menu_runner_.reset(); |
| 631 menu_model_adapter_.reset(); | 622 menu_model_adapter_.reset(); |
| 632 menu_model_.reset(); | 623 menu_model_.reset(); |
| 633 GetShelf()->UpdateVisibilityState(); | 624 GetShelf()->UpdateVisibilityState(); |
| 634 } | 625 } |
| 635 | 626 |
| 636 } // namespace ash | 627 } // namespace ash |
| OLD | NEW |