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/root_window_controller_common.h" | 5 #include "ash/common/root_window_controller_common.h" |
6 | 6 |
7 #include "ash/common/shell_window_ids.h" | 7 #include "ash/common/shell_window_ids.h" |
8 #include "ash/common/wm/root_window_layout_manager.h" | 8 #include "ash/common/wm/root_window_layout_manager.h" |
9 #include "ash/common/wm_shell.h" | 9 #include "ash/common/wm_shell.h" |
10 #include "ash/common/wm_window.h" | 10 #include "ash/common/wm_window.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 : root_(root), root_window_layout_(nullptr) {} | 30 : root_(root), root_window_layout_(nullptr) {} |
31 | 31 |
32 RootWindowControllerCommon::~RootWindowControllerCommon() {} | 32 RootWindowControllerCommon::~RootWindowControllerCommon() {} |
33 | 33 |
34 void RootWindowControllerCommon::CreateContainers() { | 34 void RootWindowControllerCommon::CreateContainers() { |
35 // These containers are just used by PowerButtonController to animate groups | 35 // These containers are just used by PowerButtonController to animate groups |
36 // of containers simultaneously without messing up the current transformations | 36 // of containers simultaneously without messing up the current transformations |
37 // on those containers. These are direct children of the root window; all of | 37 // on those containers. These are direct children of the root window; all of |
38 // the other containers are their children. | 38 // the other containers are their children. |
39 | 39 |
40 // The desktop background container is not part of the lock animation, so it | 40 // The wallpaper container is not part of the lock animation, so it is not |
41 // is not included in those animate groups. | 41 // included in those animate groups. When the screen is locked, the wallpaper |
42 // When screen is locked desktop background is moved to lock screen background | 42 // is moved to the lock screen wallpaper container (and moved back on unlock). |
43 // container (moved back on unlock). We want to make sure that there's an | 43 // Ensure that there's an opaque layer occluding the non-lock-screen layers. |
44 // opaque layer occluding the non-lock-screen layers. | 44 WmWindow* wallpaper_container = CreateContainer( |
45 WmWindow* desktop_background_container = | 45 kShellWindowId_WallpaperContainer, "WallpaperContainer", root_); |
46 CreateContainer(kShellWindowId_DesktopBackgroundContainer, | 46 wallpaper_container->SetChildWindowVisibilityChangesAnimated(); |
47 "DesktopBackgroundContainer", root_); | |
48 desktop_background_container->SetChildWindowVisibilityChangesAnimated(); | |
49 | 47 |
50 WmWindow* non_lock_screen_containers = | 48 WmWindow* non_lock_screen_containers = |
51 CreateContainer(kShellWindowId_NonLockScreenContainersContainer, | 49 CreateContainer(kShellWindowId_NonLockScreenContainersContainer, |
52 "NonLockScreenContainersContainer", root_); | 50 "NonLockScreenContainersContainer", root_); |
53 // Clip all windows inside this container, as half pixel of the window's | 51 // Clip all windows inside this container, as half pixel of the window's |
54 // texture may become visible when the screen is scaled. crbug.com/368591. | 52 // texture may become visible when the screen is scaled. crbug.com/368591. |
55 non_lock_screen_containers->SetMasksToBounds(true); | 53 non_lock_screen_containers->SetMasksToBounds(true); |
56 | 54 |
57 WmWindow* lock_background_containers = | 55 WmWindow* lock_wallpaper_containers = |
58 CreateContainer(kShellWindowId_LockScreenBackgroundContainer, | 56 CreateContainer(kShellWindowId_LockScreenWallpaperContainer, |
59 "LockScreenBackgroundContainer", root_); | 57 "LockScreenWallpaperContainer", root_); |
60 lock_background_containers->SetChildWindowVisibilityChangesAnimated(); | 58 lock_wallpaper_containers->SetChildWindowVisibilityChangesAnimated(); |
61 | 59 |
62 WmWindow* lock_screen_containers = | 60 WmWindow* lock_screen_containers = |
63 CreateContainer(kShellWindowId_LockScreenContainersContainer, | 61 CreateContainer(kShellWindowId_LockScreenContainersContainer, |
64 "LockScreenContainersContainer", root_); | 62 "LockScreenContainersContainer", root_); |
65 WmWindow* lock_screen_related_containers = | 63 WmWindow* lock_screen_related_containers = |
66 CreateContainer(kShellWindowId_LockScreenRelatedContainersContainer, | 64 CreateContainer(kShellWindowId_LockScreenRelatedContainersContainer, |
67 "LockScreenRelatedContainersContainer", root_); | 65 "LockScreenRelatedContainersContainer", root_); |
68 | 66 |
69 CreateContainer(kShellWindowId_UnparentedControlContainer, | 67 CreateContainer(kShellWindowId_UnparentedControlContainer, |
70 "UnparentedControlContainer", non_lock_screen_containers); | 68 "UnparentedControlContainer", non_lock_screen_containers); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 CreateContainer(kShellWindowId_PowerButtonAnimationContainer, | 208 CreateContainer(kShellWindowId_PowerButtonAnimationContainer, |
211 "PowerButtonAnimationContainer", root_); | 209 "PowerButtonAnimationContainer", root_); |
212 } | 210 } |
213 | 211 |
214 void RootWindowControllerCommon::CreateLayoutManagers() { | 212 void RootWindowControllerCommon::CreateLayoutManagers() { |
215 root_window_layout_ = new wm::RootWindowLayoutManager(root_); | 213 root_window_layout_ = new wm::RootWindowLayoutManager(root_); |
216 root_->SetLayoutManager(base::WrapUnique(root_window_layout_)); | 214 root_->SetLayoutManager(base::WrapUnique(root_window_layout_)); |
217 } | 215 } |
218 | 216 |
219 } // namespace ash | 217 } // namespace ash |
OLD | NEW |