| Index: ash/wm/stacking_controller.cc
|
| diff --git a/ash/wm/stacking_controller.cc b/ash/wm/stacking_controller.cc
|
| index 570c8f3c33e150390c192213317269bb50a02651..6603181b79dc9f293ef95aca52f10cd949f66f41 100644
|
| --- a/ash/wm/stacking_controller.cc
|
| +++ b/ash/wm/stacking_controller.cc
|
| @@ -15,6 +15,7 @@
|
| #include "ui/aura/root_window.h"
|
| #include "ui/aura/window.h"
|
| #include "ui/base/ui_base_types.h"
|
| +#include "ui/views/corewm/window_util.h"
|
|
|
| namespace ash {
|
| namespace {
|
| @@ -37,9 +38,10 @@ bool IsSystemModal(aura::Window* window) {
|
| return window->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_SYSTEM;
|
| }
|
|
|
| -bool HasTransientParentWindow(aura::Window* window) {
|
| - return window->transient_parent() &&
|
| - window->transient_parent()->type() != ui::wm::WINDOW_TYPE_UNKNOWN;
|
| +bool HasTransientParentWindow(const aura::Window* window) {
|
| + return views::corewm::GetTransientParent(window) &&
|
| + views::corewm::GetTransientParent(window)->type() !=
|
| + ui::wm::WINDOW_TYPE_UNKNOWN;
|
| }
|
|
|
| internal::AlwaysOnTopController*
|
| @@ -66,9 +68,10 @@ aura::Window* StackingController::GetDefaultParent(aura::Window* context,
|
| aura::Window* window,
|
| const gfx::Rect& bounds) {
|
| aura::Window* target_root = NULL;
|
| - if (window->transient_parent()) {
|
| + aura::Window* transient_parent = views::corewm::GetTransientParent(window);
|
| + if (transient_parent) {
|
| // Transient window should use the same root as its transient parent.
|
| - target_root = window->transient_parent()->GetRootWindow();
|
| + target_root = transient_parent->GetRootWindow();
|
| } else {
|
| target_root = FindContainerRoot(bounds);
|
| }
|
| @@ -80,7 +83,7 @@ aura::Window* StackingController::GetDefaultParent(aura::Window* context,
|
| return GetSystemModalContainer(target_root, window);
|
| else if (HasTransientParentWindow(window))
|
| return internal::RootWindowController::GetContainerForWindow(
|
| - window->transient_parent());
|
| + views::corewm::GetTransientParent(window));
|
| return GetAlwaysOnTopController(target_root)->GetContainer(window);
|
| case ui::wm::WINDOW_TYPE_CONTROL:
|
| return GetContainerById(
|
| @@ -120,14 +123,15 @@ aura::Window* StackingController::GetSystemModalContainer(
|
| SessionStateDelegate* session_state_delegate =
|
| Shell::GetInstance()->session_state_delegate();
|
| if (!session_state_delegate->IsUserSessionBlocked() ||
|
| - !window->transient_parent()) {
|
| + !views::corewm::GetTransientParent(window)) {
|
| return GetContainerById(root,
|
| internal::kShellWindowId_SystemModalContainer);
|
| }
|
|
|
| // Otherwise those that originate from LockScreen container and above are
|
| // placed in the screen lock modal container.
|
| - int window_container_id = window->transient_parent()->parent()->id();
|
| + int window_container_id =
|
| + views::corewm::GetTransientParent(window)->parent()->id();
|
| aura::Window* container = NULL;
|
| if (window_container_id < internal::kShellWindowId_LockScreenContainer) {
|
| container = GetContainerById(
|
|
|