Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2036)

Unified Diff: ash/wm/stacking_controller.cc

Issue 115453004: Moves management of transients out of Window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix MRUWindowTracker and MultiProfileMultiBrowserShelfLayoutChromeLauncherControllerTest Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/wm/stacking_controller.cc
diff --git a/ash/wm/stacking_controller.cc b/ash/wm/stacking_controller.cc
index 915eed41d4357352dab3ff07487016aa4c3e219c..99ff8845911550b790cf3cde592d0de0802468b7 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/transient_window_manager.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() != aura::client::WINDOW_TYPE_UNKNOWN;
+bool HasTransientParentWindow(const aura::Window* window) {
+ return views::corewm::GetTransientParent(window) &&
+ views::corewm::GetTransientParent(window)->type() !=
+ aura::client::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 aura::client::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(

Powered by Google App Engine
This is Rietveld 408576698