Chromium Code Reviews| 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(); |
|
sky
2016/05/31 17:00:57
Why is this code no longer necessary?
sadrul
2016/05/31 17:25:14
As the comment suggests, this isn't really correct
|
| - 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(); |