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

Unified Diff: chrome/browser/ui/views/chrome_views_delegate.cc

Issue 2667703002: Linux Aura: Use Aura theme on all windows when 'Use Classic theme' is used (Closed)
Patch Set: Created 3 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
Index: chrome/browser/ui/views/chrome_views_delegate.cc
diff --git a/chrome/browser/ui/views/chrome_views_delegate.cc b/chrome/browser/ui/views/chrome_views_delegate.cc
index 96f14b1e5e8cb7e254ffe4a62e89f2e160e8a484..87bbda50623ad495ae31320a2a98dbbfd0b2c64b 100644
--- a/chrome/browser/ui/views/chrome_views_delegate.cc
+++ b/chrome/browser/ui/views/chrome_views_delegate.cc
@@ -450,20 +450,20 @@ void ChromeViewsDelegate::OnBeforeWidgetInit(
// While the majority of the time, context wasn't plumbed through due to the
// existence of a global WindowParentingClient, if this window is toplevel,
// it's possible that there is no contextual state that we can use.
- if (params->parent == NULL && params->context == NULL && !params->child) {
+ if (!params->parent && !params->context && !params->child)
params->native_widget = new views::DesktopNativeWidgetAura(delegate);
- } else if (use_non_toplevel_window) {
- views::NativeWidgetAura* native_widget =
- new views::NativeWidgetAura(delegate);
- if (params->parent) {
- Profile* parent_profile = reinterpret_cast<Profile*>(
- params->parent->GetNativeWindowProperty(Profile::kProfileKey));
- native_widget->SetNativeWindowProperty(Profile::kProfileKey,
- parent_profile);
- }
- params->native_widget = native_widget;
- } else {
+ else if (use_non_toplevel_window)
+ params->native_widget = new views::NativeWidgetAura(delegate);
+ else
params->native_widget = new views::DesktopNativeWidgetAura(delegate);
+ auto* context = params->parent ? params->parent : params->context;
Tom (Use chromium acct) 2017/01/30 20:40:32 Not entirely sure if params->context is OK to use
sky 2017/01/31 00:44:12 context is ok as long as we only use GetNativeWind
Tom (Use chromium acct) 2017/01/31 02:22:25 Done.
+ if (context) {
+ auto* native_widget =
+ reinterpret_cast<views::internal::NativeWidgetPrivate*>(
sky 2017/01/31 00:44:12 static_cast?
Tom (Use chromium acct) 2017/01/31 02:21:53 Done.
+ params->native_widget);
+ native_widget->SetNativeWindowProperty(
+ Profile::kProfileKey,
+ context->GetNativeWindowProperty(Profile::kProfileKey));
}
#endif
}

Powered by Google App Engine
This is Rietveld 408576698