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