| 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_state_delegate.h" | 8 #include "ash/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" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 aura::RootWindow* root, | 122 aura::RootWindow* root, |
| 123 aura::Window* window) const { | 123 aura::Window* window) const { |
| 124 DCHECK(IsSystemModal(window)); | 124 DCHECK(IsSystemModal(window)); |
| 125 | 125 |
| 126 // If screen lock is not active and user session is active, | 126 // If screen lock is not active and user session is active, |
| 127 // all modal windows are placed into the normal modal container. | 127 // all modal windows are placed into the normal modal container. |
| 128 // In case of missing transient parent (it could happen for alerts from | 128 // In case of missing transient parent (it could happen for alerts from |
| 129 // background pages) assume that the window belongs to user session. | 129 // background pages) assume that the window belongs to user session. |
| 130 SessionStateDelegate* session_state_delegate = | 130 SessionStateDelegate* session_state_delegate = |
| 131 Shell::GetInstance()->session_state_delegate(); | 131 Shell::GetInstance()->session_state_delegate(); |
| 132 if ((!session_state_delegate->IsScreenLocked() && | 132 if (!session_state_delegate->IsUserSessionBlocked() || |
| 133 session_state_delegate->IsActiveUserSessionStarted()) || | |
| 134 !window->transient_parent()) { | 133 !window->transient_parent()) { |
| 135 return GetContainerById(root, | 134 return GetContainerById(root, |
| 136 internal::kShellWindowId_SystemModalContainer); | 135 internal::kShellWindowId_SystemModalContainer); |
| 137 } | 136 } |
| 138 | 137 |
| 139 // Otherwise those that originate from LockScreen container and above are | 138 // Otherwise those that originate from LockScreen container and above are |
| 140 // placed in the screen lock modal container. | 139 // placed in the screen lock modal container. |
| 141 int window_container_id = window->transient_parent()->parent()->id(); | 140 int window_container_id = window->transient_parent()->parent()->id(); |
| 142 aura::Window* container = NULL; | 141 aura::Window* container = NULL; |
| 143 if (window_container_id < internal::kShellWindowId_LockScreenContainer) { | 142 if (window_container_id < internal::kShellWindowId_LockScreenContainer) { |
| 144 container = GetContainerById( | 143 container = GetContainerById( |
| 145 root, internal::kShellWindowId_SystemModalContainer); | 144 root, internal::kShellWindowId_SystemModalContainer); |
| 146 } else { | 145 } else { |
| 147 container = GetContainerById( | 146 container = GetContainerById( |
| 148 root, internal::kShellWindowId_LockSystemModalContainer); | 147 root, internal::kShellWindowId_LockSystemModalContainer); |
| 149 } | 148 } |
| 150 | 149 |
| 151 return container; | 150 return container; |
| 152 } | 151 } |
| 153 | 152 |
| 154 } // namespace ash | 153 } // namespace ash |
| OLD | NEW |