| 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/common/session/session_state_delegate.h" | 7 #include "ash/common/session/session_state_delegate.h" |
| 8 #include "ash/common/shelf/shelf_layout_manager.h" | 8 #include "ash/common/shelf/shelf_layout_manager.h" |
| 9 #include "ash/common/shelf/shelf_widget.h" | 9 #include "ash/common/shelf/shelf_widget.h" |
| 10 #include "ash/common/shelf/wm_shelf.h" | 10 #include "ash/common/shelf/wm_shelf.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 } | 208 } |
| 209 | 209 |
| 210 // Notify shell observers that the shelf has been created. | 210 // Notify shell observers that the shelf has been created. |
| 211 // TODO(jamescook): Move this into WmShelf::InitializeShelf(). This will | 211 // TODO(jamescook): Move this into WmShelf::InitializeShelf(). This will |
| 212 // require changing AttachedPanelWidgetTargeter's access to WmShelf. | 212 // require changing AttachedPanelWidgetTargeter's access to WmShelf. |
| 213 WmShell::Get()->NotifyShelfCreatedForRootWindow(GetWindow()); | 213 WmShell::Get()->NotifyShelfCreatedForRootWindow(GetWindow()); |
| 214 | 214 |
| 215 shelf->shelf_widget()->PostCreateShelf(); | 215 shelf->shelf_widget()->PostCreateShelf(); |
| 216 } | 216 } |
| 217 | 217 |
| 218 void WmRootWindowController::ShowShelf() { | |
| 219 WmShelf* shelf = GetShelf(); | |
| 220 if (!shelf->IsShelfInitialized()) | |
| 221 return; | |
| 222 // TODO(jamescook): Move this into WmShelf. | |
| 223 shelf->shelf_widget()->SetShelfVisibility(true); | |
| 224 shelf->shelf_widget()->status_area_widget()->Show(); | |
| 225 } | |
| 226 | |
| 227 SystemTray* WmRootWindowController::GetSystemTray() { | 218 SystemTray* WmRootWindowController::GetSystemTray() { |
| 228 ShelfWidget* shelf_widget = GetShelf()->shelf_widget(); | 219 ShelfWidget* shelf_widget = GetShelf()->shelf_widget(); |
| 229 if (!shelf_widget || !shelf_widget->status_area_widget()) | 220 if (!shelf_widget || !shelf_widget->status_area_widget()) |
| 230 return nullptr; | 221 return nullptr; |
| 231 return shelf_widget->status_area_widget()->system_tray(); | 222 return shelf_widget->status_area_widget()->system_tray(); |
| 232 } | 223 } |
| 233 | 224 |
| 234 WmWindow* WmRootWindowController::GetContainer(int container_id) { | 225 WmWindow* WmRootWindowController::GetContainer(int container_id) { |
| 235 return root_->GetChildByShellWindowId(container_id); | 226 return root_->GetChildByShellWindowId(container_id); |
| 236 } | 227 } |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 } | 585 } |
| 595 | 586 |
| 596 void WmRootWindowController::OnMenuClosed() { | 587 void WmRootWindowController::OnMenuClosed() { |
| 597 menu_runner_.reset(); | 588 menu_runner_.reset(); |
| 598 menu_model_adapter_.reset(); | 589 menu_model_adapter_.reset(); |
| 599 menu_model_.reset(); | 590 menu_model_.reset(); |
| 600 GetShelf()->UpdateVisibilityState(); | 591 GetShelf()->UpdateVisibilityState(); |
| 601 } | 592 } |
| 602 | 593 |
| 603 } // namespace ash | 594 } // namespace ash |
| OLD | NEW |