summaryrefslogtreecommitdiffstats
path: root/ui/views/widget
diff options
context:
space:
mode:
Diffstat (limited to 'ui/views/widget')
-rw-r--r--ui/views/widget/native_widget_aura.cc4
-rw-r--r--ui/views/widget/native_widget_win.cc6
-rw-r--r--ui/views/widget/root_view.cc5
-rw-r--r--ui/views/widget/root_view.h3
-rw-r--r--ui/views/widget/widget.cc20
-rw-r--r--ui/views/widget/widget.h10
6 files changed, 24 insertions, 24 deletions
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc
index 5348f24..f9ebed7 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -1089,7 +1089,7 @@ void NativeWidgetPrivate::ReparentNativeView(gfx::NativeView native_view,
// from their previous parent.
for (Widget::Widgets::iterator it = widgets.begin();
it != widgets.end(); ++it) {
- (*it)->NotifyNativeViewHierarchyChanged(false, previous_parent);
+ (*it)->NotifyNativeViewHierarchyWillChange();
}
if (new_parent) {
@@ -1114,7 +1114,7 @@ void NativeWidgetPrivate::ReparentNativeView(gfx::NativeView native_view,
// 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);
+ (*it)->NotifyNativeViewHierarchyChanged();
}
}
diff --git a/ui/views/widget/native_widget_win.cc b/ui/views/widget/native_widget_win.cc
index c0b84b6..472ff9c 100644
--- a/ui/views/widget/native_widget_win.cc
+++ b/ui/views/widget/native_widget_win.cc
@@ -1009,9 +1009,7 @@ void NativeWidgetPrivate::ReparentNativeView(gfx::NativeView native_view,
// from their previous parent.
for (Widget::Widgets::iterator it = widgets.begin();
it != widgets.end(); ++it) {
- // TODO(beng): Rename this notification to NotifyNativeViewChanging()
- // and eliminate the bool parameter.
- (*it)->NotifyNativeViewHierarchyChanged(false, previous_parent);
+ (*it)->NotifyNativeViewHierarchyWillChange();
}
::SetParent(native_view, new_parent);
@@ -1019,7 +1017,7 @@ void NativeWidgetPrivate::ReparentNativeView(gfx::NativeView native_view,
// 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);
+ (*it)->NotifyNativeViewHierarchyChanged();
}
}
diff --git a/ui/views/widget/root_view.cc b/ui/views/widget/root_view.cc
index b304c52..d580e45 100644
--- a/ui/views/widget/root_view.cc
+++ b/ui/views/widget/root_view.cc
@@ -102,9 +102,8 @@ View* RootView::GetContentsView() {
return child_count() > 0 ? child_at(0) : NULL;
}
-void RootView::NotifyNativeViewHierarchyChanged(bool attached,
- gfx::NativeView native_view) {
- PropagateNativeViewHierarchyChanged(attached, native_view, this);
+void RootView::NotifyNativeViewHierarchyChanged() {
+ PropagateNativeViewHierarchyChanged();
}
// Input -----------------------------------------------------------------------
diff --git a/ui/views/widget/root_view.h b/ui/views/widget/root_view.h
index b89ab8f..053e7d1 100644
--- a/ui/views/widget/root_view.h
+++ b/ui/views/widget/root_view.h
@@ -60,8 +60,7 @@ class VIEWS_EXPORT RootView : public View,
View* GetContentsView();
// Called when parent of the host changed.
- void NotifyNativeViewHierarchyChanged(bool attached,
- gfx::NativeView native_view);
+ void NotifyNativeViewHierarchyChanged();
// Input ---------------------------------------------------------------------
diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc
index 0de8ccf..4bf2a85 100644
--- a/ui/views/widget/widget.cc
+++ b/ui/views/widget/widget.cc
@@ -427,16 +427,16 @@ void Widget::ViewHierarchyChanged(
}
}
-void Widget::NotifyNativeViewHierarchyChanged(bool attached,
- gfx::NativeView native_view) {
- if (!attached) {
- FocusManager* focus_manager = GetFocusManager();
- // We are being removed from a window hierarchy. Treat this as
- // the root_view_ being removed.
- if (focus_manager)
- focus_manager->ViewRemoved(root_view_.get());
- }
- root_view_->NotifyNativeViewHierarchyChanged(attached, native_view);
+void Widget::NotifyNativeViewHierarchyWillChange() {
+ FocusManager* focus_manager = GetFocusManager();
+ // We are being removed from a window hierarchy. Treat this as
+ // the root_view_ being removed.
+ if (focus_manager)
+ focus_manager->ViewRemoved(root_view_.get());
+}
+
+void Widget::NotifyNativeViewHierarchyChanged() {
+ root_view_->NotifyNativeViewHierarchyChanged();
}
// Converted methods (see header) ----------------------------------------------
diff --git a/ui/views/widget/widget.h b/ui/views/widget/widget.h
index ed64f3b..e6067eb 100644
--- a/ui/views/widget/widget.h
+++ b/ui/views/widget/widget.h
@@ -331,9 +331,13 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
// Forwarded from the RootView so that the widget can do any cleanup.
void ViewHierarchyChanged(const View::ViewHierarchyChangedDetails& details);
- // Performs any necessary cleanup and forwards to RootView.
- void NotifyNativeViewHierarchyChanged(bool attached,
- gfx::NativeView native_view);
+ // Called right before changing the widget's parent NativeView to do any
+ // cleanup.
+ void NotifyNativeViewHierarchyWillChange();
+
+ // Called after changing the widget's parent NativeView. Notifies the RootView
+ // about the change.
+ void NotifyNativeViewHierarchyChanged();
// Returns the top level widget in a hierarchy (see is_top_level() for
// the definition of top level widget.) Will return NULL if called