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/root_window_controller_common.h" | 5 #include "ash/root_window_controller_common.h" |
6 | 6 |
7 #include "ash/common/wm/wm_globals.h" | 7 #include "ash/common/wm/wm_globals.h" |
8 #include "ash/common/wm/wm_window.h" | 8 #include "ash/common/wm/wm_window.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
| 10 #include "ash/wm/root_window_layout_manager.h" |
| 11 #include "base/memory/ptr_util.h" |
10 | 12 |
11 namespace ash { | 13 namespace ash { |
12 namespace { | 14 namespace { |
13 | 15 |
14 // Creates a new window for use as a container. | 16 // Creates a new window for use as a container. |
15 wm::WmWindow* CreateContainer(int window_id, | 17 wm::WmWindow* CreateContainer(int window_id, |
16 const char* name, | 18 const char* name, |
17 wm::WmWindow* parent) { | 19 wm::WmWindow* parent) { |
18 wm::WmWindow* window = wm::WmGlobals::Get()->NewContainerWindow(); | 20 wm::WmWindow* window = wm::WmGlobals::Get()->NewContainerWindow(); |
19 window->SetShellWindowId(window_id); | 21 window->SetShellWindowId(window_id); |
20 window->SetName(name); | 22 window->SetName(name); |
21 parent->AddChild(window); | 23 parent->AddChild(window); |
22 if (window_id != kShellWindowId_UnparentedControlContainer) | 24 if (window_id != kShellWindowId_UnparentedControlContainer) |
23 window->Show(); | 25 window->Show(); |
24 return window; | 26 return window; |
25 } | 27 } |
26 | 28 |
27 } // namespace | 29 } // namespace |
28 | 30 |
29 RootWindowControllerCommon::RootWindowControllerCommon(wm::WmWindow* root) | 31 RootWindowControllerCommon::RootWindowControllerCommon(wm::WmWindow* root) |
30 : root_(root) {} | 32 : root_(root), root_window_layout_(nullptr) {} |
31 | 33 |
32 RootWindowControllerCommon::~RootWindowControllerCommon() {} | 34 RootWindowControllerCommon::~RootWindowControllerCommon() {} |
33 | 35 |
34 void RootWindowControllerCommon::CreateContainers() { | 36 void RootWindowControllerCommon::CreateContainers() { |
35 // These containers are just used by PowerButtonController to animate groups | 37 // These containers are just used by PowerButtonController to animate groups |
36 // of containers simultaneously without messing up the current transformations | 38 // of containers simultaneously without messing up the current transformations |
37 // on those containers. These are direct children of the root window; all of | 39 // on those containers. These are direct children of the root window; all of |
38 // the other containers are their children. | 40 // the other containers are their children. |
39 | 41 |
40 // The desktop background container is not part of the lock animation, so it | 42 // The desktop background container is not part of the lock animation, so it |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 wm::WmWindow* mouse_cursor_container = CreateContainer( | 206 wm::WmWindow* mouse_cursor_container = CreateContainer( |
205 kShellWindowId_MouseCursorContainer, "MouseCursorContainer", root_); | 207 kShellWindowId_MouseCursorContainer, "MouseCursorContainer", root_); |
206 mouse_cursor_container->SetBoundsInScreenBehaviorForChildren( | 208 mouse_cursor_container->SetBoundsInScreenBehaviorForChildren( |
207 wm::WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); | 209 wm::WmWindow::BoundsInScreenBehavior::USE_SCREEN_COORDINATES); |
208 #endif | 210 #endif |
209 | 211 |
210 CreateContainer(kShellWindowId_PowerButtonAnimationContainer, | 212 CreateContainer(kShellWindowId_PowerButtonAnimationContainer, |
211 "PowerButtonAnimationContainer", root_); | 213 "PowerButtonAnimationContainer", root_); |
212 } | 214 } |
213 | 215 |
| 216 void RootWindowControllerCommon::CreateLayoutManagers() { |
| 217 root_window_layout_ = new wm::RootWindowLayoutManager(root_); |
| 218 root_->SetLayoutManager(base::WrapUnique(root_window_layout_)); |
| 219 } |
| 220 |
214 } // namespace ash | 221 } // namespace ash |
OLD | NEW |