| 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 |
| 218 SystemTray* WmRootWindowController::GetSystemTray() { | 227 SystemTray* WmRootWindowController::GetSystemTray() { |
| 219 ShelfWidget* shelf_widget = GetShelf()->shelf_widget(); | 228 ShelfWidget* shelf_widget = GetShelf()->shelf_widget(); |
| 220 if (!shelf_widget || !shelf_widget->status_area_widget()) | 229 if (!shelf_widget || !shelf_widget->status_area_widget()) |
| 221 return nullptr; | 230 return nullptr; |
| 222 return shelf_widget->status_area_widget()->system_tray(); | 231 return shelf_widget->status_area_widget()->system_tray(); |
| 223 } | 232 } |
| 224 | 233 |
| 225 WmWindow* WmRootWindowController::GetContainer(int container_id) { | 234 WmWindow* WmRootWindowController::GetContainer(int container_id) { |
| 226 return root_->GetChildByShellWindowId(container_id); | 235 return root_->GetChildByShellWindowId(container_id); |
| 227 } | 236 } |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 } | 592 } |
| 584 | 593 |
| 585 void WmRootWindowController::OnMenuClosed() { | 594 void WmRootWindowController::OnMenuClosed() { |
| 586 menu_runner_.reset(); | 595 menu_runner_.reset(); |
| 587 menu_model_adapter_.reset(); | 596 menu_model_adapter_.reset(); |
| 588 menu_model_.reset(); | 597 menu_model_.reset(); |
| 589 GetShelf()->UpdateVisibilityState(); | 598 GetShelf()->UpdateVisibilityState(); |
| 590 } | 599 } |
| 591 | 600 |
| 592 } // namespace ash | 601 } // namespace ash |
| OLD | NEW |