OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.h" | 5 #include "ash/root_window_controller.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/desktop_background/desktop_background_widget_controller.h" | 9 #include "ash/desktop_background/desktop_background_widget_controller.h" |
10 #include "ash/display/display_controller.h" | 10 #include "ash/display/display_controller.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // use the virtual screeen coordinates instead of parent. | 125 // use the virtual screeen coordinates instead of parent. |
126 void SetUsesScreenCoordinates(aura::Window* container) { | 126 void SetUsesScreenCoordinates(aura::Window* container) { |
127 container->SetProperty(internal::kUsesScreenCoordinatesKey, true); | 127 container->SetProperty(internal::kUsesScreenCoordinatesKey, true); |
128 } | 128 } |
129 | 129 |
130 // Creates each of the special window containers that holds windows of various | 130 // Creates each of the special window containers that holds windows of various |
131 // types in the shell UI. | 131 // types in the shell UI. |
132 void CreateContainersInRootWindow(aura::RootWindow* root_window) { | 132 void CreateContainersInRootWindow(aura::RootWindow* root_window) { |
133 // These containers are just used by PowerButtonController to animate groups | 133 // These containers are just used by PowerButtonController to animate groups |
134 // of containers simultaneously without messing up the current transformations | 134 // of containers simultaneously without messing up the current transformations |
135 // on those containers. These are direct children of the root window; all of | 135 // on those containers. These are direct children of the root window; all of |
136 // the other containers are their children. | 136 // the other containers are their children. |
| 137 // Desktop and lock screen background containers are not part of the |
| 138 // lock animation so they are not included in those animate groups. |
| 139 // When screen is locked desktop background is moved to lock screen background |
| 140 // container (moved back on unlock). We want to make sure that there's an |
| 141 // opaque layer occluding the non-lock-screen layers. |
| 142 |
| 143 aura::Window* desktop_background_containers = CreateContainer( |
| 144 internal::kShellWindowId_DesktopBackgroundContainer, |
| 145 "DesktopBackgroundContainer", |
| 146 root_window); |
| 147 SetChildWindowVisibilityChangesAnimated(desktop_background_containers); |
| 148 |
137 aura::Window* non_lock_screen_containers = CreateContainer( | 149 aura::Window* non_lock_screen_containers = CreateContainer( |
138 internal::kShellWindowId_NonLockScreenContainersContainer, | 150 internal::kShellWindowId_NonLockScreenContainersContainer, |
139 "NonLockScreenContainersContainer", | 151 "NonLockScreenContainersContainer", |
140 root_window); | 152 root_window); |
| 153 |
| 154 aura::Window* lock_background_containers = CreateContainer( |
| 155 internal::kShellWindowId_LockScreenBackgroundContainer, |
| 156 "LockScreenBackgroundContainer", |
| 157 root_window); |
| 158 SetChildWindowVisibilityChangesAnimated(lock_background_containers); |
| 159 |
141 aura::Window* lock_screen_containers = CreateContainer( | 160 aura::Window* lock_screen_containers = CreateContainer( |
142 internal::kShellWindowId_LockScreenContainersContainer, | 161 internal::kShellWindowId_LockScreenContainersContainer, |
143 "LockScreenContainersContainer", | 162 "LockScreenContainersContainer", |
144 root_window); | 163 root_window); |
145 aura::Window* lock_screen_related_containers = CreateContainer( | 164 aura::Window* lock_screen_related_containers = CreateContainer( |
146 internal::kShellWindowId_LockScreenRelatedContainersContainer, | 165 internal::kShellWindowId_LockScreenRelatedContainersContainer, |
147 "LockScreenRelatedContainersContainer", | 166 "LockScreenRelatedContainersContainer", |
148 root_window); | 167 root_window); |
149 | 168 |
150 CreateContainer(internal::kShellWindowId_UnparentedControlContainer, | 169 CreateContainer(internal::kShellWindowId_UnparentedControlContainer, |
151 "UnparentedControlContainer", | 170 "UnparentedControlContainer", |
152 non_lock_screen_containers); | 171 non_lock_screen_containers); |
153 | 172 |
154 CreateContainer(internal::kShellWindowId_SystemBackgroundContainer, | 173 CreateContainer(internal::kShellWindowId_SystemBackgroundContainer, |
155 "SystemBackgroundContainer", non_lock_screen_containers); | 174 "SystemBackgroundContainer", non_lock_screen_containers); |
156 | 175 |
157 aura::Window* desktop_background_containers = CreateContainer( | |
158 internal::kShellWindowId_DesktopBackgroundContainer, | |
159 "DesktopBackgroundContainer", | |
160 non_lock_screen_containers); | |
161 SetChildWindowVisibilityChangesAnimated(desktop_background_containers); | |
162 | |
163 aura::Window* default_container = CreateContainer( | 176 aura::Window* default_container = CreateContainer( |
164 internal::kShellWindowId_DefaultContainer, | 177 internal::kShellWindowId_DefaultContainer, |
165 "DefaultContainer", | 178 "DefaultContainer", |
166 non_lock_screen_containers); | 179 non_lock_screen_containers); |
167 default_container->SetEventFilter( | 180 default_container->SetEventFilter( |
168 new ToplevelWindowEventFilter(default_container)); | 181 new ToplevelWindowEventFilter(default_container)); |
169 SetChildWindowVisibilityChangesAnimated(default_container); | 182 SetChildWindowVisibilityChangesAnimated(default_container); |
170 SetUsesScreenCoordinates(default_container); | 183 SetUsesScreenCoordinates(default_container); |
171 | 184 |
172 aura::Window* always_on_top_container = CreateContainer( | 185 aura::Window* always_on_top_container = CreateContainer( |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 new internal::SystemModalContainerLayoutManager(modal_container)); | 217 new internal::SystemModalContainerLayoutManager(modal_container)); |
205 SetChildWindowVisibilityChangesAnimated(modal_container); | 218 SetChildWindowVisibilityChangesAnimated(modal_container); |
206 SetUsesScreenCoordinates(modal_container); | 219 SetUsesScreenCoordinates(modal_container); |
207 | 220 |
208 aura::Window* input_method_container = CreateContainer( | 221 aura::Window* input_method_container = CreateContainer( |
209 internal::kShellWindowId_InputMethodContainer, | 222 internal::kShellWindowId_InputMethodContainer, |
210 "InputMethodContainer", | 223 "InputMethodContainer", |
211 non_lock_screen_containers); | 224 non_lock_screen_containers); |
212 SetUsesScreenCoordinates(input_method_container); | 225 SetUsesScreenCoordinates(input_method_container); |
213 | 226 |
214 aura::Window* lock_background_containers = CreateContainer( | |
215 internal::kShellWindowId_LockScreenBackgroundContainer, | |
216 "LockScreenBackgroundContainer", | |
217 lock_screen_containers); | |
218 | |
219 SetChildWindowVisibilityChangesAnimated(lock_background_containers); | |
220 | |
221 // TODO(beng): Figure out if we can make this use | 227 // TODO(beng): Figure out if we can make this use |
222 // SystemModalContainerEventFilter instead of stops_event_propagation. | 228 // SystemModalContainerEventFilter instead of stops_event_propagation. |
223 aura::Window* lock_container = CreateContainer( | 229 aura::Window* lock_container = CreateContainer( |
224 internal::kShellWindowId_LockScreenContainer, | 230 internal::kShellWindowId_LockScreenContainer, |
225 "LockScreenContainer", | 231 "LockScreenContainer", |
226 lock_screen_containers); | 232 lock_screen_containers); |
227 lock_container->SetLayoutManager( | 233 lock_container->SetLayoutManager( |
228 new internal::BaseLayoutManager(root_window)); | 234 new internal::BaseLayoutManager(root_window)); |
229 SetUsesScreenCoordinates(lock_container); | 235 SetUsesScreenCoordinates(lock_container); |
230 // TODO(beng): stopsevents | 236 // TODO(beng): stopsevents |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 // Restore focused or active window if it's still alive. | 372 // Restore focused or active window if it's still alive. |
367 if (focused && tracker.Contains(focused) && dst->Contains(focused)) { | 373 if (focused && tracker.Contains(focused) && dst->Contains(focused)) { |
368 dst->GetFocusManager()->SetFocusedWindow(focused, NULL); | 374 dst->GetFocusManager()->SetFocusedWindow(focused, NULL); |
369 } else if (active && tracker.Contains(active) && dst->Contains(active)) { | 375 } else if (active && tracker.Contains(active) && dst->Contains(active)) { |
370 activation_client->ActivateWindow(active); | 376 activation_client->ActivateWindow(active); |
371 } | 377 } |
372 } | 378 } |
373 | 379 |
374 } // namespace internal | 380 } // namespace internal |
375 } // namespace ash | 381 } // namespace ash |
OLD | NEW |