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

Unified Diff: ui/views/widget/native_widget_aura.cc

Issue 2018333002: views/mus: Add support for child widgets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 7 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 | « ui/views/mus/window_manager_connection.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/native_widget_aura.cc
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc
index 66022c0c6da18e1d9e493b653673dc18fdcb2c6b..5fb420fef944fdcddf6b007a588b6b2a8ba691fb 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -1143,24 +1143,10 @@ void NativeWidgetPrivate::ReparentNativeView(gfx::NativeView native_view,
(*it)->NotifyNativeViewHierarchyWillChange();
}
- if (new_parent) {
+ if (new_parent)
new_parent->AddChild(native_view);
- } else {
- // The following looks weird, but it's the equivalent of what aura has
- // always done. (The previous behaviour of aura::Window::SetParent() used
- // NULL as a special value that meant ask the WindowTreeClient where things
- // should go.)
- //
- // This probably isn't strictly correct, but its an invariant that a Window
- // in use will be attached to a RootWindow, so we can't just call
- // RemoveChild here. The only possible thing that could assign a RootWindow
- // in this case is the stacking client of the current RootWindow. This
- // matches our previous behaviour; the global stacking client would almost
- // always reattach the window to the same RootWindow.
- aura::Window* root_window = native_view->GetRootWindow();
- aura::client::ParentWindowWithContext(
- native_view, root_window, root_window->GetBoundsInScreen());
- }
+ else if (previous_parent)
+ previous_parent->RemoveChild(native_view);
// And now, notify them that they have a brand new parent.
for (Widget::Widgets::iterator it = widgets.begin();
« no previous file with comments | « ui/views/mus/window_manager_connection.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698