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

Unified Diff: ui/views/mus/native_widget_mus.cc

Issue 2484813002: Add child for parent_mus when params.parent_mus is not initialized. (Closed)
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/native_widget_mus.cc
diff --git a/ui/views/mus/native_widget_mus.cc b/ui/views/mus/native_widget_mus.cc
index bfce92136a3e543ab7ce4bb89e6533b7ddb9f097..3b78af79b5b95ec93a62a891df58431c4e1a328f 100644
--- a/ui/views/mus/native_widget_mus.cc
+++ b/ui/views/mus/native_widget_mus.cc
@@ -775,17 +775,20 @@ void NativeWidgetMus::InitNativeWidget(const Widget::InitParams& params) {
content_->set_ignore_events(!params.accept_events);
hosted_window->AddChild(content_);
+ if (params.parent_mus)
mfomitchev 2016/11/07 18:19:23 Can we make it so we only do AddChild once? Someth
thanhph 2016/11/07 19:50:56 Thanks. I also add the if condition to prevent SEG
mfomitchev 2016/11/07 20:16:47 Cool, thanks!
+ params.parent_mus->AddChild(window_);
+
// Set-up transiency if appropriate.
if (params.parent && !params.child) {
aura::Window* parent_root = params.parent->GetRootWindow();
ui::Window* parent_mus = parent_root->GetProperty(kMusWindow);
- if (parent_mus)
+ if (parent_mus) {
parent_mus->AddTransientWindow(window_);
+ if (!params.parent_mus)
+ parent_mus->AddChild(window_);
+ }
}
- if (params.parent_mus)
- params.parent_mus->AddChild(window_);
-
// TODO(sky): deal with show state.
if (!params.bounds.size().IsEmpty())
SetBounds(params.bounds);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698