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/mus/root_window_controller.h" | 5 #include "ash/mus/root_window_controller.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
11 #include <sstream> | 11 #include <sstream> |
12 #include <string> | 12 #include <string> |
13 #include <utility> | 13 #include <utility> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "ash/common/root_window_controller_common.h" | 16 #include "ash/common/root_window_controller_common.h" |
| 17 #include "ash/common/session/session_state_delegate.h" |
17 #include "ash/common/shell_window_ids.h" | 18 #include "ash/common/shell_window_ids.h" |
| 19 #include "ash/common/system/status_area_widget.h" |
18 #include "ash/common/wm/always_on_top_controller.h" | 20 #include "ash/common/wm/always_on_top_controller.h" |
19 #include "ash/common/wm/container_finder.h" | 21 #include "ash/common/wm/container_finder.h" |
20 #include "ash/common/wm/dock/docked_window_layout_manager.h" | 22 #include "ash/common/wm/dock/docked_window_layout_manager.h" |
21 #include "ash/common/wm/panels/panel_layout_manager.h" | 23 #include "ash/common/wm/panels/panel_layout_manager.h" |
22 #include "ash/common/wm/root_window_layout_manager.h" | 24 #include "ash/common/wm/root_window_layout_manager.h" |
23 #include "ash/common/wm/workspace/workspace_layout_manager.h" | 25 #include "ash/common/wm/workspace/workspace_layout_manager.h" |
24 #include "ash/common/wm/workspace/workspace_layout_manager_delegate.h" | 26 #include "ash/common/wm/workspace/workspace_layout_manager_delegate.h" |
25 #include "ash/mus/bridge/wm_root_window_controller_mus.h" | 27 #include "ash/mus/bridge/wm_root_window_controller_mus.h" |
26 #include "ash/mus/bridge/wm_shelf_mus.h" | 28 #include "ash/mus/bridge/wm_shelf_mus.h" |
27 #include "ash/mus/bridge/wm_shell_mus.h" | 29 #include "ash/mus/bridge/wm_shell_mus.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 return; | 216 return; |
215 | 217 |
216 docked_window_layout_manager->SetShelf(wm_shelf_.get()); | 218 docked_window_layout_manager->SetShelf(wm_shelf_.get()); |
217 | 219 |
218 PanelLayoutManager::Get(WmWindowMus::Get(root_))->SetShelf(wm_shelf_.get()); | 220 PanelLayoutManager::Get(WmWindowMus::Get(root_))->SetShelf(wm_shelf_.get()); |
219 | 221 |
220 // TODO: http://crbug.com/614182 Ash's ShelfLayoutManager implements | 222 // TODO: http://crbug.com/614182 Ash's ShelfLayoutManager implements |
221 // DockedWindowLayoutManagerObserver so that it can inset by the docked | 223 // DockedWindowLayoutManagerObserver so that it can inset by the docked |
222 // windows. | 224 // windows. |
223 // docked_layout_manager_->AddObserver(shelf_->shelf_layout_manager()); | 225 // docked_layout_manager_->AddObserver(shelf_->shelf_layout_manager()); |
| 226 |
| 227 WmWindowMus* status_container = |
| 228 GetWindowByShellWindowId(kShellWindowId_StatusContainer); |
| 229 // Owned by native widget. |
| 230 StatusAreaWidget* status_area_widget = |
| 231 new StatusAreaWidget(status_container, wm_shelf_.get()); |
| 232 status_area_widget->CreateTrayViews(); |
| 233 // TODO(jamescook): Remove this when ash::ShelfLayoutManager is working |
| 234 // in mash. http://crbug.com/621112 |
| 235 status_area_widget->SetBounds(gfx::Rect(845, 720, 120, 40)); |
| 236 if (WmShell::Get()->GetSessionStateDelegate()->IsActiveUserSessionStarted()) |
| 237 status_area_widget->Show(); |
224 } | 238 } |
225 | 239 |
226 void RootWindowController::CreateLayoutManagers() { | 240 void RootWindowController::CreateLayoutManagers() { |
227 // Override the default layout managers for certain containers. | 241 // Override the default layout managers for certain containers. |
228 WmWindowMus* lock_screen_container = | 242 WmWindowMus* lock_screen_container = |
229 GetWindowByShellWindowId(kShellWindowId_LockScreenContainer); | 243 GetWindowByShellWindowId(kShellWindowId_LockScreenContainer); |
230 layout_managers_[lock_screen_container->mus_window()].reset( | 244 layout_managers_[lock_screen_container->mus_window()].reset( |
231 new ScreenlockLayout(lock_screen_container->mus_window())); | 245 new ScreenlockLayout(lock_screen_container->mus_window())); |
232 | 246 |
233 WmWindowMus* shelf_container = | 247 WmWindowMus* shelf_container = |
(...skipping 27 matching lines...) Expand all Loading... |
261 base::WrapUnique(new DockedWindowLayoutManager(docked_container))); | 275 base::WrapUnique(new DockedWindowLayoutManager(docked_container))); |
262 | 276 |
263 WmWindowMus* panel_container = | 277 WmWindowMus* panel_container = |
264 GetWindowByShellWindowId(kShellWindowId_PanelContainer); | 278 GetWindowByShellWindowId(kShellWindowId_PanelContainer); |
265 panel_container->SetLayoutManager( | 279 panel_container->SetLayoutManager( |
266 base::WrapUnique(new PanelLayoutManager(panel_container))); | 280 base::WrapUnique(new PanelLayoutManager(panel_container))); |
267 } | 281 } |
268 | 282 |
269 } // namespace mus | 283 } // namespace mus |
270 } // namespace ash | 284 } // namespace ash |
OLD | NEW |