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

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

Issue 2693783005: Revert of Linux Aura: Use Aura theme on all windows when 'Use Classic theme' is used (Closed)
Patch Set: Created 3 years, 10 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 88741a15dc8edce8caa5472b33bda44f58baf480..96f14b1e5e8cb7e254ffe4a62e89f2e160e8a484 100644
--- a/chrome/browser/ui/views/chrome_views_delegate.cc
+++ b/chrome/browser/ui/views/chrome_views_delegate.cc
@@ -450,23 +450,20 @@
// 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.
- gfx::NativeWindow parent_or_context =
- params->parent ? params->parent : params->context;
- void* profile =
- parent_or_context
- ? parent_or_context->GetNativeWindowProperty(Profile::kProfileKey)
- : nullptr;
- if ((!params->parent && !params->context && !params->child) ||
- !use_non_toplevel_window) {
- views::DesktopNativeWidgetAura* native_widget =
- new views::DesktopNativeWidgetAura(delegate);
- params->native_widget = native_widget;
- native_widget->SetNativeWindowProperty(Profile::kProfileKey, profile);
- } else {
+ if (params->parent == NULL && params->context == NULL && !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;
- native_widget->SetNativeWindowProperty(Profile::kProfileKey, profile);
+ } else {
+ params->native_widget = new views::DesktopNativeWidgetAura(delegate);
}
#endif
}

Powered by Google App Engine
This is Rietveld 408576698