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

Unified Diff: ui/views/view.cc

Issue 1624343003: Minor fixes for WidgetRemovalsObserver::OnWillRemoveView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comment Created 4 years, 11 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/views/widget/widget_removals_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index 9ee7272bd04f4fbaa7078350e6eeb8462b484462..95f5c7037ab53e13e4915852e1b618547a1fc345 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -1798,11 +1798,14 @@ void View::DoRemoveChildView(View* view,
next_focusable->previous_focusable_view_ = prev_focusable;
}
- if (GetWidget()) {
+ Widget* widget = GetWidget();
+ if (widget) {
UnregisterChildrenForVisibleBoundsNotification(view);
if (view->visible())
view->SchedulePaint();
- GetWidget()->NotifyWillRemoveView(view);
+
+ if (!new_parent || new_parent->GetWidget() != widget)
+ widget->NotifyWillRemoveView(view);
}
view->PropagateRemoveNotifications(this, new_parent);
« no previous file with comments | « no previous file | ui/views/widget/widget_removals_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698