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

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

Issue 8741022: Implements Aura:: NativeWidgetPrivate::ReparentNativeView (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nicer diff Created 9 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 | « chrome/browser/ui/sad_tab_observer.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 7b1805e19e618da5d2093bf803acd7820315d121..cbe9c443e18da6c312b69c39c1976431e2b8b2cc 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -771,8 +771,29 @@ void NativeWidgetPrivate::GetAllChildWidgets(gfx::NativeView native_view,
// static
void NativeWidgetPrivate::ReparentNativeView(gfx::NativeView native_view,
gfx::NativeView new_parent) {
- // http://crbug.com/102576
- NOTIMPLEMENTED();
+ DCHECK(native_view != new_parent);
+
+ gfx::NativeView previous_parent = native_view->parent();
+ if (previous_parent == new_parent)
+ return;
+
+ Widget::Widgets widgets;
+ GetAllChildWidgets(native_view, &widgets);
+
+ // First notify all the widgets that they are being disassociated
+ // from their previous parent.
+ for (Widget::Widgets::iterator it = widgets.begin();
+ it != widgets.end(); ++it) {
+ (*it)->NotifyNativeViewHierarchyChanged(false, previous_parent);
+ }
+
+ native_view->SetParent(new_parent);
+
+ // And now, notify them that they have a brand new parent.
+ for (Widget::Widgets::iterator it = widgets.begin();
+ it != widgets.end(); ++it) {
+ (*it)->NotifyNativeViewHierarchyChanged(true, new_parent);
+ }
}
// static
« no previous file with comments | « chrome/browser/ui/sad_tab_observer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698