| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/container_finder.h" | 5 #include "ash/wm/container_finder.h" |
| 6 | 6 |
| 7 #include "ash/public/cpp/shell_window_ids.h" | 7 #include "ash/public/cpp/shell_window_ids.h" |
| 8 #include "ash/public/cpp/window_properties.h" | 8 #include "ash/public/cpp/window_properties.h" |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/session/session_controller.h" | 10 #include "ash/session/session_controller.h" |
| 11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 12 #include "ash/wm/always_on_top_controller.h" | 12 #include "ash/wm/always_on_top_controller.h" |
| 13 #include "ash/wm/root_window_finder.h" | 13 #include "ash/wm/root_window_finder.h" |
| 14 #include "ash/wm/window_state.h" | 14 #include "ash/wm/window_state.h" |
| 15 #include "ash/wm_window.h" | |
| 16 #include "ui/aura/client/aura_constants.h" | 15 #include "ui/aura/client/aura_constants.h" |
| 17 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
| 18 #include "ui/gfx/geometry/rect.h" | 17 #include "ui/gfx/geometry/rect.h" |
| 19 #include "ui/wm/core/window_util.h" | 18 #include "ui/wm/core/window_util.h" |
| 20 | 19 |
| 21 namespace ash { | 20 namespace ash { |
| 22 namespace wm { | 21 namespace wm { |
| 23 namespace { | 22 namespace { |
| 24 | 23 |
| 25 aura::Window* FindContainerRoot(const gfx::Rect& bounds) { | 24 aura::Window* FindContainerRoot(const gfx::Rect& bounds) { |
| 26 if (bounds == gfx::Rect()) | 25 if (bounds == gfx::Rect()) |
| 27 return Shell::GetRootWindowForNewWindows(); | 26 return Shell::GetRootWindowForNewWindows(); |
| 28 WmWindow* root = GetRootWindowMatching(bounds); | 27 return GetRootWindowMatching(bounds); |
| 29 return root ? root->aura_window() : nullptr; | |
| 30 } | 28 } |
| 31 | 29 |
| 32 bool HasTransientParentWindow(const aura::Window* window) { | 30 bool HasTransientParentWindow(const aura::Window* window) { |
| 33 const aura::Window* transient_parent = ::wm::GetTransientParent(window); | 31 const aura::Window* transient_parent = ::wm::GetTransientParent(window); |
| 34 return transient_parent && | 32 return transient_parent && |
| 35 transient_parent->type() != ui::wm::WINDOW_TYPE_UNKNOWN; | 33 transient_parent->type() != ui::wm::WINDOW_TYPE_UNKNOWN; |
| 36 } | 34 } |
| 37 | 35 |
| 38 aura::Window* GetSystemModalContainer(aura::Window* root, | 36 aura::Window* GetSystemModalContainer(aura::Window* root, |
| 39 aura::Window* window) { | 37 aura::Window* window) { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 if (priority_root && priority_root->Contains(container)) | 123 if (priority_root && priority_root->Contains(container)) |
| 126 containers.insert(containers.begin(), container); | 124 containers.insert(containers.begin(), container); |
| 127 else | 125 else |
| 128 containers.push_back(container); | 126 containers.push_back(container); |
| 129 } | 127 } |
| 130 return containers; | 128 return containers; |
| 131 } | 129 } |
| 132 | 130 |
| 133 } // namespace wm | 131 } // namespace wm |
| 134 } // namespace ash | 132 } // namespace ash |
| OLD | NEW |