| 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 <queue> | 7 #include <queue> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_constants.h" | 10 #include "ash/ash_constants.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "ash/system/status_area_widget.h" | 28 #include "ash/system/status_area_widget.h" |
| 29 #include "ash/system/tray/system_tray_delegate.h" | 29 #include "ash/system/tray/system_tray_delegate.h" |
| 30 #include "ash/system/tray/system_tray_notifier.h" | 30 #include "ash/system/tray/system_tray_notifier.h" |
| 31 #include "ash/touch/touch_hud_debug.h" | 31 #include "ash/touch/touch_hud_debug.h" |
| 32 #include "ash/touch/touch_hud_projection.h" | 32 #include "ash/touch/touch_hud_projection.h" |
| 33 #include "ash/touch/touch_observer_hud.h" | 33 #include "ash/touch/touch_observer_hud.h" |
| 34 #include "ash/wm/aura/aura_layout_manager_adapter.h" | 34 #include "ash/wm/aura/aura_layout_manager_adapter.h" |
| 35 #include "ash/wm/aura/wm_shelf_aura.h" | 35 #include "ash/wm/aura/wm_shelf_aura.h" |
| 36 #include "ash/wm/aura/wm_window_aura.h" | 36 #include "ash/wm/aura/wm_window_aura.h" |
| 37 #include "ash/wm/common/always_on_top_controller.h" | 37 #include "ash/wm/common/always_on_top_controller.h" |
| 38 #include "ash/wm/common/container_finder.h" |
| 38 #include "ash/wm/common/dock/docked_window_layout_manager.h" | 39 #include "ash/wm/common/dock/docked_window_layout_manager.h" |
| 39 #include "ash/wm/common/fullscreen_window_finder.h" | 40 #include "ash/wm/common/fullscreen_window_finder.h" |
| 40 #include "ash/wm/common/panels/panel_layout_manager.h" | 41 #include "ash/wm/common/panels/panel_layout_manager.h" |
| 41 #include "ash/wm/common/switchable_windows.h" | 42 #include "ash/wm/common/switchable_windows.h" |
| 42 #include "ash/wm/common/window_state.h" | 43 #include "ash/wm/common/window_state.h" |
| 43 #include "ash/wm/common/workspace/workspace_layout_manager.h" | 44 #include "ash/wm/common/workspace/workspace_layout_manager.h" |
| 44 #include "ash/wm/common/workspace/workspace_layout_manager_delegate.h" | 45 #include "ash/wm/common/workspace/workspace_layout_manager_delegate.h" |
| 45 #include "ash/wm/lock_layout_manager.h" | 46 #include "ash/wm/lock_layout_manager.h" |
| 46 #include "ash/wm/panels/attached_panel_window_targeter.h" | 47 #include "ash/wm/panels/attached_panel_window_targeter.h" |
| 47 #include "ash/wm/panels/panel_window_event_handler.h" | 48 #include "ash/wm/panels/panel_window_event_handler.h" |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 CHECK(Shell::HasInstance()); | 315 CHECK(Shell::HasInstance()); |
| 315 return GetRootWindowController(window->GetRootWindow()); | 316 return GetRootWindowController(window->GetRootWindow()); |
| 316 } | 317 } |
| 317 | 318 |
| 318 // static | 319 // static |
| 319 RootWindowController* RootWindowController::ForTargetRootWindow() { | 320 RootWindowController* RootWindowController::ForTargetRootWindow() { |
| 320 CHECK(Shell::HasInstance()); | 321 CHECK(Shell::HasInstance()); |
| 321 return GetRootWindowController(Shell::GetTargetRootWindow()); | 322 return GetRootWindowController(Shell::GetTargetRootWindow()); |
| 322 } | 323 } |
| 323 | 324 |
| 324 // static | |
| 325 aura::Window* RootWindowController::GetContainerForWindow( | |
| 326 aura::Window* window) { | |
| 327 aura::Window* container = window->parent(); | |
| 328 while (container && container->type() != ui::wm::WINDOW_TYPE_UNKNOWN) | |
| 329 container = container->parent(); | |
| 330 return container; | |
| 331 } | |
| 332 | |
| 333 RootWindowController::~RootWindowController() { | 325 RootWindowController::~RootWindowController() { |
| 334 Shutdown(); | 326 Shutdown(); |
| 335 ash_host_.reset(); | 327 ash_host_.reset(); |
| 336 // The CaptureClient needs to be around for as long as the RootWindow is | 328 // The CaptureClient needs to be around for as long as the RootWindow is |
| 337 // valid. | 329 // valid. |
| 338 capture_client_.reset(); | 330 capture_client_.reset(); |
| 339 } | 331 } |
| 340 | 332 |
| 341 aura::WindowTreeHost* RootWindowController::GetHost() { | 333 aura::WindowTreeHost* RootWindowController::GetHost() { |
| 342 return ash_host_->AsWindowTreeHost(); | 334 return ash_host_->AsWindowTreeHost(); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 ash_host_->PrepareForShutdown(); | 394 ash_host_->PrepareForShutdown(); |
| 403 | 395 |
| 404 system_background_.reset(); | 396 system_background_.reset(); |
| 405 aura::client::SetScreenPositionClient(root_window, NULL); | 397 aura::client::SetScreenPositionClient(root_window, NULL); |
| 406 } | 398 } |
| 407 | 399 |
| 408 SystemModalContainerLayoutManager* | 400 SystemModalContainerLayoutManager* |
| 409 RootWindowController::GetSystemModalLayoutManager(aura::Window* window) { | 401 RootWindowController::GetSystemModalLayoutManager(aura::Window* window) { |
| 410 aura::Window* modal_container = NULL; | 402 aura::Window* modal_container = NULL; |
| 411 if (window) { | 403 if (window) { |
| 412 aura::Window* window_container = GetContainerForWindow(window); | 404 aura::Window* window_container = wm::WmWindowAura::GetAuraWindow( |
| 405 wm::GetContainerForWindow(wm::WmWindowAura::Get(window))); |
| 413 if (window_container && | 406 if (window_container && |
| 414 window_container->id() >= kShellWindowId_LockScreenContainer) { | 407 window_container->id() >= kShellWindowId_LockScreenContainer) { |
| 415 modal_container = GetContainer(kShellWindowId_LockSystemModalContainer); | 408 modal_container = GetContainer(kShellWindowId_LockSystemModalContainer); |
| 416 } else { | 409 } else { |
| 417 modal_container = GetContainer(kShellWindowId_SystemModalContainer); | 410 modal_container = GetContainer(kShellWindowId_SystemModalContainer); |
| 418 } | 411 } |
| 419 } else { | 412 } else { |
| 420 int modal_window_id = Shell::GetInstance()->session_state_delegate() | 413 int modal_window_id = Shell::GetInstance()->session_state_delegate() |
| 421 ->IsUserSessionBlocked() ? kShellWindowId_LockSystemModalContainer : | 414 ->IsUserSessionBlocked() ? kShellWindowId_LockSystemModalContainer : |
| 422 kShellWindowId_SystemModalContainer; | 415 kShellWindowId_SystemModalContainer; |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1060 else | 1053 else |
| 1061 DisableTouchHudProjection(); | 1054 DisableTouchHudProjection(); |
| 1062 } | 1055 } |
| 1063 | 1056 |
| 1064 RootWindowController* GetRootWindowController( | 1057 RootWindowController* GetRootWindowController( |
| 1065 const aura::Window* root_window) { | 1058 const aura::Window* root_window) { |
| 1066 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; | 1059 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; |
| 1067 } | 1060 } |
| 1068 | 1061 |
| 1069 } // namespace ash | 1062 } // namespace ash |
| OLD | NEW |