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

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: remove unneeded parens Created 6 years, 11 months 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
« no previous file with comments | « ash/wm/panels/panel_window_resizer_unittest.cc ('k') | ash/wm/stacking_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « ash/wm/panels/panel_window_resizer_unittest.cc ('k') | ash/wm/stacking_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698