| 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" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // Otherwise those that originate from LockScreen container and above are | 53 // Otherwise those that originate from LockScreen container and above are |
| 54 // placed in the screen lock modal container. | 54 // placed in the screen lock modal container. |
| 55 int window_container_id = transient_parent->parent()->id(); | 55 int window_container_id = transient_parent->parent()->id(); |
| 56 if (window_container_id < kShellWindowId_LockScreenContainer) | 56 if (window_container_id < kShellWindowId_LockScreenContainer) |
| 57 return root->GetChildById(kShellWindowId_SystemModalContainer); | 57 return root->GetChildById(kShellWindowId_SystemModalContainer); |
| 58 return root->GetChildById(kShellWindowId_LockSystemModalContainer); | 58 return root->GetChildById(kShellWindowId_LockSystemModalContainer); |
| 59 } | 59 } |
| 60 | 60 |
| 61 aura::Window* GetContainerFromAlwaysOnTopController(aura::Window* root, | 61 aura::Window* GetContainerFromAlwaysOnTopController(aura::Window* root, |
| 62 aura::Window* window) { | 62 aura::Window* window) { |
| 63 WmWindow* result = RootWindowController::ForWindow(root) | 63 return RootWindowController::ForWindow(root) |
| 64 ->always_on_top_controller() | 64 ->always_on_top_controller() |
| 65 ->GetContainer(WmWindow::Get(window)); | 65 ->GetContainer(window); |
| 66 return result ? result->aura_window() : nullptr; | |
| 67 } | 66 } |
| 68 | 67 |
| 69 } // namespace | 68 } // namespace |
| 70 | 69 |
| 71 aura::Window* GetContainerForWindow(aura::Window* window) { | 70 aura::Window* GetContainerForWindow(aura::Window* window) { |
| 72 aura::Window* parent = window->parent(); | 71 aura::Window* parent = window->parent(); |
| 73 // The first parent with an explicit shell window ID is the container. | 72 // The first parent with an explicit shell window ID is the container. |
| 74 while (parent && parent->id() == kShellWindowId_Invalid) | 73 while (parent && parent->id() == kShellWindowId_Invalid) |
| 75 parent = parent->parent(); | 74 parent = parent->parent(); |
| 76 return parent; | 75 return parent; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 if (priority_root && priority_root->Contains(container)) | 125 if (priority_root && priority_root->Contains(container)) |
| 127 containers.insert(containers.begin(), container); | 126 containers.insert(containers.begin(), container); |
| 128 else | 127 else |
| 129 containers.push_back(container); | 128 containers.push_back(container); |
| 130 } | 129 } |
| 131 return containers; | 130 return containers; |
| 132 } | 131 } |
| 133 | 132 |
| 134 } // namespace wm | 133 } // namespace wm |
| 135 } // namespace ash | 134 } // namespace ash |
| OLD | NEW |