Index: ui/aura/window.cc |
diff --git a/ui/aura/window.cc b/ui/aura/window.cc |
index 1626947ff0e4d1ce1a4467e89d6e17f8b353ed7b..cc9672bd7565bd8b6b33a904419ac8de0d71ba71 100644 |
--- a/ui/aura/window.cc |
+++ b/ui/aura/window.cc |
@@ -33,19 +33,6 @@ |
namespace aura { |
-namespace { |
- |
-Window* GetParentForWindow(Window* window, Window* suggested_parent) { |
- if (suggested_parent) |
- return suggested_parent; |
- if (client::GetStackingClient()) |
- return client::GetStackingClient()->GetDefaultParent( |
- window, window, gfx::Rect()); |
- return NULL; |
-} |
- |
-} // namespace |
- |
Window::TestApi::TestApi(Window* window) : window_(window) {} |
bool Window::TestApi::OwnsLayer() const { |
@@ -333,8 +320,22 @@ void Window::SetExternalTexture(ui::Texture* texture) { |
WindowObserver, observers_, OnWindowPaintScheduled(this, region)); |
} |
-void Window::SetParent(Window* parent) { |
- GetParentForWindow(this, parent)->AddChild(this); |
+void Window::SetParentTo(Window* parent) { |
Ben Goodger (Google)
2012/11/20 23:46:38
Since you're renaming this method, can you just ge
|
+ DCHECK(parent); |
+ parent->AddChild(this); |
+} |
+ |
+void Window::SetDefaultParentByTargetRoot(RootWindow* context_root) { |
+ // TODO(erg): Enable this DCHECK once it is safe. |
+ // DCHECK(context_root); |
+ |
+ // Stacking clients are mandatory on RootWindow objects. |
+ client::StackingClient* client = client::GetStackingClient(context_root); |
+ DCHECK(client); |
+ |
+ aura::Window* default_parent = client->GetDefaultParent( |
+ context_root, this, gfx::Rect()); |
+ default_parent->AddChild(this); |
} |
void Window::StackChildAtTop(Window* child) { |