Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: ash/common/wm_root_window_controller.cc

Issue 2401803002: Moves Shell::ShowShelf() to WmShell (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/common/wm_root_window_controller.h ('k') | ash/common/wm_shell.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_widget.h"
8 #include "ash/common/shelf/wm_shelf.h" 9 #include "ash/common/shelf/wm_shelf.h"
9 #include "ash/common/shell_delegate.h" 10 #include "ash/common/shell_delegate.h"
10 #include "ash/common/shell_window_ids.h" 11 #include "ash/common/shell_window_ids.h"
12 #include "ash/common/system/status_area_widget.h"
11 #include "ash/common/wallpaper/wallpaper_delegate.h" 13 #include "ash/common/wallpaper/wallpaper_delegate.h"
12 #include "ash/common/wallpaper/wallpaper_widget_controller.h" 14 #include "ash/common/wallpaper/wallpaper_widget_controller.h"
13 #include "ash/common/wm/always_on_top_controller.h" 15 #include "ash/common/wm/always_on_top_controller.h"
14 #include "ash/common/wm/container_finder.h" 16 #include "ash/common/wm/container_finder.h"
15 #include "ash/common/wm/dock/docked_window_layout_manager.h" 17 #include "ash/common/wm/dock/docked_window_layout_manager.h"
16 #include "ash/common/wm/lock_layout_manager.h" 18 #include "ash/common/wm/lock_layout_manager.h"
17 #include "ash/common/wm/panels/panel_layout_manager.h" 19 #include "ash/common/wm/panels/panel_layout_manager.h"
18 #include "ash/common/wm/root_window_layout_manager.h" 20 #include "ash/common/wm/root_window_layout_manager.h"
19 #include "ash/common/wm/system_modal_container_layout_manager.h" 21 #include "ash/common/wm/system_modal_container_layout_manager.h"
20 #include "ash/common/wm/window_state.h" 22 #include "ash/common/wm/window_state.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 WmShell::Get()->GetSessionStateDelegate()->IsUserSessionBlocked() 185 WmShell::Get()->GetSessionStateDelegate()->IsUserSessionBlocked()
184 ? kShellWindowId_LockSystemModalContainer 186 ? kShellWindowId_LockSystemModalContainer
185 : kShellWindowId_SystemModalContainer; 187 : kShellWindowId_SystemModalContainer;
186 modal_container = GetContainer(modal_window_id); 188 modal_container = GetContainer(modal_window_id);
187 } 189 }
188 return modal_container ? static_cast<SystemModalContainerLayoutManager*>( 190 return modal_container ? static_cast<SystemModalContainerLayoutManager*>(
189 modal_container->GetLayoutManager()) 191 modal_container->GetLayoutManager())
190 : nullptr; 192 : nullptr;
191 } 193 }
192 194
195 void WmRootWindowController::ShowShelf() {
196 WmShelf* shelf = GetShelf();
197 if (!shelf->IsShelfInitialized())
198 return;
199 // TODO(jamescook): Move this into WmShelf.
200 shelf->shelf_widget()->SetShelfVisibility(true);
201 shelf->shelf_widget()->status_area_widget()->Show();
202 }
203
193 WmWindow* WmRootWindowController::GetContainer(int container_id) { 204 WmWindow* WmRootWindowController::GetContainer(int container_id) {
194 return root_->GetChildByShellWindowId(container_id); 205 return root_->GetChildByShellWindowId(container_id);
195 } 206 }
196 207
197 const WmWindow* WmRootWindowController::GetContainer(int container_id) const { 208 const WmWindow* WmRootWindowController::GetContainer(int container_id) const {
198 return root_->GetChildByShellWindowId(container_id); 209 return root_->GetChildByShellWindowId(container_id);
199 } 210 }
200 211
201 void WmRootWindowController::ShowContextMenu( 212 void WmRootWindowController::ShowContextMenu(
202 const gfx::Point& location_in_screen, 213 const gfx::Point& location_in_screen,
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 } 555 }
545 556
546 void WmRootWindowController::OnMenuClosed() { 557 void WmRootWindowController::OnMenuClosed() {
547 menu_runner_.reset(); 558 menu_runner_.reset();
548 menu_model_adapter_.reset(); 559 menu_model_adapter_.reset();
549 menu_model_.reset(); 560 menu_model_.reset();
550 GetShelf()->UpdateVisibilityState(); 561 GetShelf()->UpdateVisibilityState();
551 } 562 }
552 563
553 } // namespace ash 564 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm_root_window_controller.h ('k') | ash/common/wm_shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698