| 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/wm/stacking_controller.h" | 5 #include "ash/wm/stacking_controller.h" |
| 6 | 6 |
| 7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/session/session_state_delegate.h" | 8 #include "ash/session/session_state_delegate.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| 11 #include "ash/wm/always_on_top_controller.h" | 11 #include "ash/wm/always_on_top_controller.h" |
| 12 #include "ash/wm/coordinate_conversion.h" | 12 #include "ash/wm/aura/wm_window_aura.h" |
| 13 #include "ash/wm/common/root_window_finder.h" |
| 13 #include "ash/wm/window_state.h" | 14 #include "ash/wm/window_state.h" |
| 14 #include "ash/wm/window_state_aura.h" | 15 #include "ash/wm/window_state_aura.h" |
| 15 #include "ui/aura/client/aura_constants.h" | 16 #include "ui/aura/client/aura_constants.h" |
| 16 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
| 17 #include "ui/aura/window_event_dispatcher.h" | 18 #include "ui/aura/window_event_dispatcher.h" |
| 18 #include "ui/base/ui_base_types.h" | 19 #include "ui/base/ui_base_types.h" |
| 19 #include "ui/wm/core/window_util.h" | 20 #include "ui/wm/core/window_util.h" |
| 20 | 21 |
| 21 namespace ash { | 22 namespace ash { |
| 22 namespace { | 23 namespace { |
| 23 | 24 |
| 24 // Find a root window that matches the |bounds|. If the virtual screen | 25 // Find a root window that matches the |bounds|. If the virtual screen |
| 25 // coordinates is enabled and the bounds is specified, the root window | 26 // coordinates is enabled and the bounds is specified, the root window |
| 26 // that matches the window's bound will be used. Otherwise, it'll | 27 // that matches the window's bound will be used. Otherwise, it'll |
| 27 // return the active root window. | 28 // return the active root window. |
| 28 aura::Window* FindContainerRoot(const gfx::Rect& bounds) { | 29 aura::Window* FindContainerRoot(const gfx::Rect& bounds) { |
| 29 if (bounds.x() == 0 && bounds.y() == 0 && bounds.IsEmpty()) | 30 if (bounds.x() == 0 && bounds.y() == 0 && bounds.IsEmpty()) |
| 30 return Shell::GetTargetRootWindow(); | 31 return Shell::GetTargetRootWindow(); |
| 31 return wm::GetRootWindowMatching(bounds); | 32 return wm::WmWindowAura::GetAuraWindow(wm::GetRootWindowMatching(bounds)); |
| 32 } | 33 } |
| 33 | 34 |
| 34 aura::Window* GetContainerById(aura::Window* root, int id) { | 35 aura::Window* GetContainerById(aura::Window* root, int id) { |
| 35 return Shell::GetContainer(root, id); | 36 return Shell::GetContainer(root, id); |
| 36 } | 37 } |
| 37 | 38 |
| 38 bool IsSystemModal(aura::Window* window) { | 39 bool IsSystemModal(aura::Window* window) { |
| 39 return window->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_SYSTEM; | 40 return window->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_SYSTEM; |
| 40 } | 41 } |
| 41 | 42 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 if (window_container_id < kShellWindowId_LockScreenContainer) { | 133 if (window_container_id < kShellWindowId_LockScreenContainer) { |
| 133 container = GetContainerById(root, kShellWindowId_SystemModalContainer); | 134 container = GetContainerById(root, kShellWindowId_SystemModalContainer); |
| 134 } else { | 135 } else { |
| 135 container = GetContainerById(root, kShellWindowId_LockSystemModalContainer); | 136 container = GetContainerById(root, kShellWindowId_LockSystemModalContainer); |
| 136 } | 137 } |
| 137 | 138 |
| 138 return container; | 139 return container; |
| 139 } | 140 } |
| 140 | 141 |
| 141 } // namespace ash | 142 } // namespace ash |
| OLD | NEW |