| 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 void WmRootWindowController::ShowShelf() { | 218 void WmRootWindowController::ShowShelf() { |
| 219 WmShelf* shelf = GetShelf(); | 219 WmShelf* shelf = GetShelf(); |
| 220 if (!shelf->IsShelfInitialized()) | 220 if (!shelf->IsShelfInitialized()) |
| 221 return; | 221 return; |
| 222 // TODO(jamescook): Move this into WmShelf. | 222 // TODO(jamescook): Move this into WmShelf. |
| 223 shelf->shelf_widget()->SetShelfVisibility(true); | 223 shelf->shelf_widget()->SetShelfVisibility(true); |
| 224 shelf->shelf_widget()->status_area_widget()->Show(); | 224 shelf->shelf_widget()->status_area_widget()->Show(); |
| 225 } | 225 } |
| 226 | 226 |
| 227 SystemTray* WmRootWindowController::GetSystemTray() { |
| 228 ShelfWidget* shelf_widget = GetShelf()->shelf_widget(); |
| 229 if (!shelf_widget || !shelf_widget->status_area_widget()) |
| 230 return nullptr; |
| 231 return shelf_widget->status_area_widget()->system_tray(); |
| 232 } |
| 233 |
| 227 WmWindow* WmRootWindowController::GetContainer(int container_id) { | 234 WmWindow* WmRootWindowController::GetContainer(int container_id) { |
| 228 return root_->GetChildByShellWindowId(container_id); | 235 return root_->GetChildByShellWindowId(container_id); |
| 229 } | 236 } |
| 230 | 237 |
| 231 const WmWindow* WmRootWindowController::GetContainer(int container_id) const { | 238 const WmWindow* WmRootWindowController::GetContainer(int container_id) const { |
| 232 return root_->GetChildByShellWindowId(container_id); | 239 return root_->GetChildByShellWindowId(container_id); |
| 233 } | 240 } |
| 234 | 241 |
| 235 void WmRootWindowController::ShowContextMenu( | 242 void WmRootWindowController::ShowContextMenu( |
| 236 const gfx::Point& location_in_screen, | 243 const gfx::Point& location_in_screen, |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 } | 594 } |
| 588 | 595 |
| 589 void WmRootWindowController::OnMenuClosed() { | 596 void WmRootWindowController::OnMenuClosed() { |
| 590 menu_runner_.reset(); | 597 menu_runner_.reset(); |
| 591 menu_model_adapter_.reset(); | 598 menu_model_adapter_.reset(); |
| 592 menu_model_.reset(); | 599 menu_model_.reset(); |
| 593 GetShelf()->UpdateVisibilityState(); | 600 GetShelf()->UpdateVisibilityState(); |
| 594 } | 601 } |
| 595 | 602 |
| 596 } // namespace ash | 603 } // namespace ash |
| OLD | NEW |