| 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/common/wm/container_finder.h" | 5 #include "ash/common/wm/container_finder.h" |
| 6 | 6 |
| 7 #include "ash/common/session/session_state_delegate.h" | 7 #include "ash/common/session/session_controller.h" |
| 8 #include "ash/common/wm/always_on_top_controller.h" | 8 #include "ash/common/wm/always_on_top_controller.h" |
| 9 #include "ash/common/wm/root_window_finder.h" | 9 #include "ash/common/wm/root_window_finder.h" |
| 10 #include "ash/common/wm/window_state.h" | 10 #include "ash/common/wm/window_state.h" |
| 11 #include "ash/common/wm_shell.h" | 11 #include "ash/common/wm_shell.h" |
| 12 #include "ash/common/wm_window.h" | 12 #include "ash/common/wm_window.h" |
| 13 #include "ash/public/cpp/shell_window_ids.h" | 13 #include "ash/public/cpp/shell_window_ids.h" |
| 14 #include "ash/public/cpp/window_properties.h" | 14 #include "ash/public/cpp/window_properties.h" |
| 15 #include "ash/root_window_controller.h" | 15 #include "ash/root_window_controller.h" |
| 16 #include "ash/shell.h" | 16 #include "ash/shell.h" |
| 17 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 32 window->GetTransientParent()->GetType() != ui::wm::WINDOW_TYPE_UNKNOWN; | 32 window->GetTransientParent()->GetType() != ui::wm::WINDOW_TYPE_UNKNOWN; |
| 33 } | 33 } |
| 34 | 34 |
| 35 WmWindow* GetSystemModalContainer(WmWindow* root, WmWindow* window) { | 35 WmWindow* GetSystemModalContainer(WmWindow* root, WmWindow* window) { |
| 36 DCHECK(window->IsSystemModal()); | 36 DCHECK(window->IsSystemModal()); |
| 37 | 37 |
| 38 // If screen lock is not active and user session is active, | 38 // If screen lock is not active and user session is active, |
| 39 // all modal windows are placed into the normal modal container. | 39 // all modal windows are placed into the normal modal container. |
| 40 // In case of missing transient parent (it could happen for alerts from | 40 // In case of missing transient parent (it could happen for alerts from |
| 41 // background pages) assume that the window belongs to user session. | 41 // background pages) assume that the window belongs to user session. |
| 42 if (!window->GetShell()->GetSessionStateDelegate()->IsUserSessionBlocked() || | 42 if (!WmShell::Get()->session_controller()->IsUserSessionBlocked() || |
| 43 !window->GetTransientParent()) { | 43 !window->GetTransientParent()) { |
| 44 return root->GetChildByShellWindowId(kShellWindowId_SystemModalContainer); | 44 return root->GetChildByShellWindowId(kShellWindowId_SystemModalContainer); |
| 45 } | 45 } |
| 46 | 46 |
| 47 // Otherwise those that originate from LockScreen container and above are | 47 // Otherwise those that originate from LockScreen container and above are |
| 48 // placed in the screen lock modal container. | 48 // placed in the screen lock modal container. |
| 49 int window_container_id = | 49 int window_container_id = |
| 50 window->GetTransientParent()->GetParent()->GetShellWindowId(); | 50 window->GetTransientParent()->GetParent()->GetShellWindowId(); |
| 51 if (window_container_id < kShellWindowId_LockScreenContainer) | 51 if (window_container_id < kShellWindowId_LockScreenContainer) |
| 52 return root->GetChildByShellWindowId(kShellWindowId_SystemModalContainer); | 52 return root->GetChildByShellWindowId(kShellWindowId_SystemModalContainer); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 if (priority_root && priority_root->Contains(container)) | 123 if (priority_root && priority_root->Contains(container)) |
| 124 containers.insert(containers.begin(), container); | 124 containers.insert(containers.begin(), container); |
| 125 else | 125 else |
| 126 containers.push_back(container); | 126 containers.push_back(container); |
| 127 } | 127 } |
| 128 return containers; | 128 return containers; |
| 129 } | 129 } |
| 130 | 130 |
| 131 } // namespace wm | 131 } // namespace wm |
| 132 } // namespace ash | 132 } // namespace ash |
| OLD | NEW |