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_shell.h" | 5 #include "ash/common/wm_shell.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ash/common/accelerators/accelerator_controller.h" | 9 #include "ash/common/accelerators/accelerator_controller.h" |
10 #include "ash/common/accelerators/ash_focus_manager_factory.h" | 10 #include "ash/common/accelerators/ash_focus_manager_factory.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 if (GetSessionStateDelegate()->NumberOfLoggedInUsers() < 1 || | 110 if (GetSessionStateDelegate()->NumberOfLoggedInUsers() < 1 || |
111 GetSessionStateDelegate()->IsScreenLocked()) { | 111 GetSessionStateDelegate()->IsScreenLocked()) { |
112 return; | 112 return; |
113 } | 113 } |
114 | 114 |
115 WmWindow* root = wm::GetRootWindowAt(location_in_screen); | 115 WmWindow* root = wm::GetRootWindowAt(location_in_screen); |
116 root->GetRootWindowController()->ShowContextMenu(location_in_screen, | 116 root->GetRootWindowController()->ShowContextMenu(location_in_screen, |
117 source_type); | 117 source_type); |
118 } | 118 } |
119 | 119 |
| 120 void WmShell::CreateShelf() { |
| 121 // Must occur after SessionStateDelegate creation and user login. |
| 122 DCHECK(GetSessionStateDelegate()); |
| 123 DCHECK_GT(GetSessionStateDelegate()->NumberOfLoggedInUsers(), 0); |
| 124 CreateShelfDelegate(); |
| 125 |
| 126 for (WmWindow* root_window : GetAllRootWindows()) |
| 127 root_window->GetRootWindowController()->CreateShelf(); |
| 128 } |
| 129 |
120 void WmShell::ShowShelf() { | 130 void WmShell::ShowShelf() { |
121 for (WmWindow* root_window : GetAllRootWindows()) | 131 for (WmWindow* root_window : GetAllRootWindows()) |
122 root_window->GetRootWindowController()->ShowShelf(); | 132 root_window->GetRootWindowController()->ShowShelf(); |
123 } | 133 } |
124 | 134 |
125 void WmShell::CreateShelfDelegate() { | 135 void WmShell::CreateShelfDelegate() { |
126 // May be called multiple times as shelves are created and destroyed. | 136 // May be called multiple times as shelves are created and destroyed. |
127 if (shelf_delegate_) | 137 if (shelf_delegate_) |
128 return; | 138 return; |
129 // Must occur after SessionStateDelegate creation and user login because | 139 // Must occur after SessionStateDelegate creation and user login because |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 void WmShell::DeleteToastManager() { | 367 void WmShell::DeleteToastManager() { |
358 toast_manager_.reset(); | 368 toast_manager_.reset(); |
359 } | 369 } |
360 | 370 |
361 void WmShell::SetAcceleratorController( | 371 void WmShell::SetAcceleratorController( |
362 std::unique_ptr<AcceleratorController> accelerator_controller) { | 372 std::unique_ptr<AcceleratorController> accelerator_controller) { |
363 accelerator_controller_ = std::move(accelerator_controller); | 373 accelerator_controller_ = std::move(accelerator_controller); |
364 } | 374 } |
365 | 375 |
366 } // namespace ash | 376 } // namespace ash |
OLD | NEW |