Chromium Code Reviews| 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" |
| 11 #include "ash/display/multi_display_manager.h" | 11 #include "ash/display/multi_display_manager.h" |
| 12 #include "ash/shell.h" | 12 #include "ash/shell.h" |
| 13 #include "ash/shell_factory.h" | 13 #include "ash/shell_factory.h" |
| 14 #include "ash/shell_window_ids.h" | 14 #include "ash/shell_window_ids.h" |
| 15 #include "ash/system/tray/system_tray_delegate.h" | |
| 15 #include "ash/wm/base_layout_manager.h" | 16 #include "ash/wm/base_layout_manager.h" |
| 16 #include "ash/wm/property_util.h" | 17 #include "ash/wm/property_util.h" |
| 17 #include "ash/wm/root_window_layout_manager.h" | 18 #include "ash/wm/root_window_layout_manager.h" |
| 18 #include "ash/wm/screen_dimmer.h" | 19 #include "ash/wm/screen_dimmer.h" |
| 19 #include "ash/wm/system_modal_container_layout_manager.h" | 20 #include "ash/wm/system_modal_container_layout_manager.h" |
| 20 #include "ash/wm/toplevel_window_event_handler.h" | 21 #include "ash/wm/toplevel_window_event_handler.h" |
| 21 #include "ash/wm/visibility_controller.h" | 22 #include "ash/wm/visibility_controller.h" |
| 22 #include "ash/wm/window_properties.h" | 23 #include "ash/wm/window_properties.h" |
| 23 #include "ash/wm/workspace/colored_window_controller.h" | 24 #include "ash/wm/workspace/colored_window_controller.h" |
| 24 #include "ash/wm/workspace_controller.h" | 25 #include "ash/wm/workspace_controller.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 162 screen_dimmer_.reset(); | 163 screen_dimmer_.reset(); |
| 163 workspace_controller_.reset(); | 164 workspace_controller_.reset(); |
| 164 // Forget with the display ID so that display lookup | 165 // Forget with the display ID so that display lookup |
| 165 // ends up with invalid display. | 166 // ends up with invalid display. |
| 166 root_window_->ClearProperty(kDisplayIdKey); | 167 root_window_->ClearProperty(kDisplayIdKey); |
| 167 // And this root window should no longer process events. | 168 // And this root window should no longer process events. |
| 168 root_window_->PrepareForShutdown(); | 169 root_window_->PrepareForShutdown(); |
| 169 } | 170 } |
| 170 | 171 |
| 171 SystemModalContainerLayoutManager* | 172 SystemModalContainerLayoutManager* |
| 172 RootWindowController::GetSystemModalLayoutManager() { | 173 RootWindowController::GetSystemModalLayoutManager(aura::Window* window) { |
| 174 aura::Window* container = NULL; | |
| 175 if (window) { | |
| 176 container = GetContainer( | |
| 177 kShellWindowId_LockSystemModalContainer); | |
| 178 if (!container->Contains(window)) | |
| 179 container = GetContainer(kShellWindowId_SystemModalContainer); | |
| 180 } else { | |
| 181 user::LoginStatus login = Shell::GetInstance()->tray_delegate() ? | |
| 182 Shell::GetInstance()->tray_delegate()->GetUserLoginStatus() : | |
|
sky
2012/10/12 17:00:37
nit: indent 4 for 182/183.
How come we have user l
sadrul
2012/10/12 18:24:30
Agree. Filed http://code.google.com/p/chromium/iss
| |
| 183 user::LOGGED_IN_NONE; | |
| 184 int modal_window_id = (login == user::LOGGED_IN_LOCKED || | |
| 185 login == user::LOGGED_IN_NONE) ? | |
| 186 kShellWindowId_LockSystemModalContainer : | |
| 187 kShellWindowId_SystemModalContainer; | |
| 188 container = GetContainer(modal_window_id); | |
| 189 } | |
| 173 return static_cast<SystemModalContainerLayoutManager*>( | 190 return static_cast<SystemModalContainerLayoutManager*>( |
| 174 GetContainer(kShellWindowId_SystemModalContainer)->layout_manager()); | 191 container->layout_manager()); |
| 175 } | 192 } |
| 176 | 193 |
| 177 aura::Window* RootWindowController::GetContainer(int container_id) { | 194 aura::Window* RootWindowController::GetContainer(int container_id) { |
| 178 return root_window_->GetChildById(container_id); | 195 return root_window_->GetChildById(container_id); |
| 179 } | 196 } |
| 180 | 197 |
| 181 void RootWindowController::InitLayoutManagers() { | 198 void RootWindowController::InitLayoutManagers() { |
| 182 root_window_layout_ = | 199 root_window_layout_ = |
| 183 new RootWindowLayoutManager(root_window_.get()); | 200 new RootWindowLayoutManager(root_window_.get()); |
| 184 root_window_->SetLayoutManager(root_window_layout_); | 201 root_window_->SetLayoutManager(root_window_layout_); |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 424 | 441 |
| 425 aura::Window* overlay_container = CreateContainer( | 442 aura::Window* overlay_container = CreateContainer( |
| 426 kShellWindowId_OverlayContainer, | 443 kShellWindowId_OverlayContainer, |
| 427 "OverlayContainer", | 444 "OverlayContainer", |
| 428 lock_screen_related_containers); | 445 lock_screen_related_containers); |
| 429 SetUsesScreenCoordinates(overlay_container); | 446 SetUsesScreenCoordinates(overlay_container); |
| 430 } | 447 } |
| 431 | 448 |
| 432 } // namespace internal | 449 } // namespace internal |
| 433 } // namespace ash | 450 } // namespace ash |
| OLD | NEW |