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/display/display_controller.h" | 10 #include "ash/display/display_controller.h" |
10 #include "ash/shell.h" | 11 #include "ash/shell.h" |
11 #include "ash/shell_factory.h" | 12 #include "ash/shell_factory.h" |
12 #include "ash/shell_window_ids.h" | 13 #include "ash/shell_window_ids.h" |
13 #include "ash/wm/base_layout_manager.h" | 14 #include "ash/wm/base_layout_manager.h" |
14 #include "ash/wm/event_client_impl.h" | 15 #include "ash/wm/event_client_impl.h" |
15 #include "ash/wm/property_util.h" | 16 #include "ash/wm/property_util.h" |
16 #include "ash/wm/root_window_layout_manager.h" | 17 #include "ash/wm/root_window_layout_manager.h" |
17 #include "ash/wm/screen_dimmer.h" | 18 #include "ash/wm/screen_dimmer.h" |
18 #include "ash/wm/system_modal_container_layout_manager.h" | 19 #include "ash/wm/system_modal_container_layout_manager.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 new internal::SystemModalContainerLayoutManager(modal_container)); | 163 new internal::SystemModalContainerLayoutManager(modal_container)); |
163 SetChildWindowVisibilityChangesAnimated(modal_container); | 164 SetChildWindowVisibilityChangesAnimated(modal_container); |
164 SetUsesScreenCoordinates(modal_container); | 165 SetUsesScreenCoordinates(modal_container); |
165 | 166 |
166 aura::Window* input_method_container = CreateContainer( | 167 aura::Window* input_method_container = CreateContainer( |
167 internal::kShellWindowId_InputMethodContainer, | 168 internal::kShellWindowId_InputMethodContainer, |
168 "InputMethodContainer", | 169 "InputMethodContainer", |
169 non_lock_screen_containers); | 170 non_lock_screen_containers); |
170 SetUsesScreenCoordinates(input_method_container); | 171 SetUsesScreenCoordinates(input_method_container); |
171 | 172 |
| 173 aura::Window* lock_background_containers = CreateContainer( |
| 174 internal::kShellWindowId_LockScreenBackgroundContainer, |
| 175 "LockScreenBackgroundContainer", |
| 176 lock_screen_containers); |
| 177 |
| 178 SetChildWindowVisibilityChangesAnimated(lock_background_containers); |
| 179 |
172 // TODO(beng): Figure out if we can make this use | 180 // TODO(beng): Figure out if we can make this use |
173 // SystemModalContainerEventFilter instead of stops_event_propagation. | 181 // SystemModalContainerEventFilter instead of stops_event_propagation. |
174 aura::Window* lock_container = CreateContainer( | 182 aura::Window* lock_container = CreateContainer( |
175 internal::kShellWindowId_LockScreenContainer, | 183 internal::kShellWindowId_LockScreenContainer, |
176 "LockScreenContainer", | 184 "LockScreenContainer", |
177 lock_screen_containers); | 185 lock_screen_containers); |
178 lock_container->SetLayoutManager( | 186 lock_container->SetLayoutManager( |
179 new internal::BaseLayoutManager(root_window)); | 187 new internal::BaseLayoutManager(root_window)); |
180 SetUsesScreenCoordinates(lock_container); | 188 SetUsesScreenCoordinates(lock_container); |
181 // TODO(beng): stopsevents | 189 // TODO(beng): stopsevents |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 new internal::BaseLayoutManager( | 279 new internal::BaseLayoutManager( |
272 always_on_top_container->GetRootWindow())); | 280 always_on_top_container->GetRootWindow())); |
273 } | 281 } |
274 | 282 |
275 void RootWindowController::CreateContainers() { | 283 void RootWindowController::CreateContainers() { |
276 CreateContainersInRootWindow(root_window_.get()); | 284 CreateContainersInRootWindow(root_window_.get()); |
277 } | 285 } |
278 | 286 |
279 void RootWindowController::CloseChildWindows() { | 287 void RootWindowController::CloseChildWindows() { |
280 // Close background widget first as it depends on tooltip. | 288 // Close background widget first as it depends on tooltip. |
281 root_window_layout_->SetBackgroundWidget(NULL); | 289 root_window_->SetProperty(kWindowDesktopComponent, |
| 290 static_cast<DesktopBackgroundWidgetController*>(NULL)); |
| 291 |
282 workspace_controller_.reset(); | 292 workspace_controller_.reset(); |
283 aura::client::SetTooltipClient(root_window_.get(), NULL); | 293 aura::client::SetTooltipClient(root_window_.get(), NULL); |
284 | 294 |
285 while (!root_window_->children().empty()) { | 295 while (!root_window_->children().empty()) { |
286 aura::Window* child = root_window_->children()[0]; | 296 aura::Window* child = root_window_->children()[0]; |
287 delete child; | 297 delete child; |
288 } | 298 } |
289 } | 299 } |
290 | 300 |
291 bool RootWindowController::IsInMaximizedMode() const { | 301 bool RootWindowController::IsInMaximizedMode() const { |
(...skipping 21 matching lines...) Expand all Loading... |
313 // Restore focused or active window if it's still alive. | 323 // Restore focused or active window if it's still alive. |
314 if (focused && tracker.Contains(focused) && dst->Contains(focused)) { | 324 if (focused && tracker.Contains(focused) && dst->Contains(focused)) { |
315 dst->GetFocusManager()->SetFocusedWindow(focused, NULL); | 325 dst->GetFocusManager()->SetFocusedWindow(focused, NULL); |
316 } else if (active && tracker.Contains(active) && dst->Contains(active)) { | 326 } else if (active && tracker.Contains(active) && dst->Contains(active)) { |
317 activation_client->ActivateWindow(active); | 327 activation_client->ActivateWindow(active); |
318 } | 328 } |
319 } | 329 } |
320 | 330 |
321 } // namespace internal | 331 } // namespace internal |
322 } // namespace ash | 332 } // namespace ash |
OLD | NEW |