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

Unified Diff: ui/aura/window.cc

Issue 241243002: Changes layer reparenting to happen after a window parent is changed in aura::Window::AddChild (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changes layer reparenting to happen after a window parent is changed (GetAncestorWithLayer timing) Created 6 years, 8 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 | « no previous file | 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 899fdfdb047c14b76f8a72ce270380c75eb911c7..4bb4bbdfab6b7c2dbc4a5198c8ad7b63275d3ad3 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -516,13 +516,14 @@ void Window::AddChild(Window* child) {
gfx::Vector2d offset;
aura::Window* ancestor_with_layer = GetAncestorWithLayer(&offset);
+
+ child->parent_ = this;
+
if (ancestor_with_layer) {
offset += child->bounds().OffsetFromOrigin();
child->ReparentLayers(ancestor_with_layer->layer(), offset);
}
- child->parent_ = this;
-
children_.push_back(child);
if (layout_manager_)
layout_manager_->OnWindowAddedToLayout(child);
« no previous file with comments | « no previous file | ui/aura/window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698