Commit ed179c4f authored by estade@chromium.org's avatar estade@chromium.org

Fix first time switching from classic to GTK theme.

Make sure Widget observes the correct NativeTheme. Wait until everything else is done initializing so GetNativeTheme() returns the right thing.

BUG=384492

Review URL: https://codereview.chromium.org/330873003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278334 0039d316-1c4b-4281-b951-d872f2087c98
parent f6841b93
...@@ -356,7 +356,6 @@ void Widget::Init(const InitParams& in_params) { ...@@ -356,7 +356,6 @@ void Widget::Init(const InitParams& in_params) {
internal::NativeWidgetPrivate::IsMouseButtonDown(); internal::NativeWidgetPrivate::IsMouseButtonDown();
} }
native_widget_->InitNativeWidget(params); native_widget_->InitNativeWidget(params);
observer_manager_.Add(GetNativeTheme());
if (RequiresNonClientView(params.type)) { if (RequiresNonClientView(params.type)) {
non_client_view_ = new NonClientView; non_client_view_ = new NonClientView;
non_client_view_->SetFrameView(CreateNonClientFrameView()); non_client_view_->SetFrameView(CreateNonClientFrameView());
...@@ -378,6 +377,9 @@ void Widget::Init(const InitParams& in_params) { ...@@ -378,6 +377,9 @@ void Widget::Init(const InitParams& in_params) {
SetContentsView(params.delegate->GetContentsView()); SetContentsView(params.delegate->GetContentsView());
SetInitialBoundsForFramelessWindow(params.bounds); SetInitialBoundsForFramelessWindow(params.bounds);
} }
// This must come after SetContentsView() or it might not be able to find
// the correct NativeTheme (on Linux). See http://crbug.com/384492
observer_manager_.Add(GetNativeTheme());
native_widget_initialized_ = true; native_widget_initialized_ = true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment