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

Unified Diff: ui/aura/window.cc

Issue 11421006: Desktop aura: Break aura::Window::SetParent in two. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ash_unittests Created 8 years, 1 month 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 | « ui/aura/window.h ('k') | ui/aura/window_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window.cc
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index 5bd94294c20fd2dd9f307fdea63bdce808a379a5..5b127932f59e77735fb2e37a875cc8b0ce9402e4 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,18 @@ void Window::SetExternalTexture(ui::Texture* texture) {
WindowObserver, observers_, OnWindowPaintScheduled(this, region));
}
-void Window::SetParent(Window* parent) {
- GetParentForWindow(this, parent)->AddChild(this);
+void Window::SetDefaultParentByRootWindow(RootWindow* root_window,
+ const gfx::Rect& bounds_in_screen) {
+ // TODO(erg): Enable this DCHECK once it is safe.
+ // DCHECK(root_window);
+
+ // Stacking clients are mandatory on RootWindow objects.
+ client::StackingClient* client = client::GetStackingClient(root_window);
+ DCHECK(client);
+
+ aura::Window* default_parent = client->GetDefaultParent(
+ root_window, this, bounds_in_screen);
+ default_parent->AddChild(this);
}
void Window::StackChildAtTop(Window* child) {
« no previous file with comments | « ui/aura/window.h ('k') | ui/aura/window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698