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

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

Issue 2697513008: Linux Aura: Use Aura theme on all windows when 'Use Classic theme' is used (Closed)
Patch Set: Move kThemeProfileKey into c/b/ui/views/frame/browser_view.h 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 c02c35b4f57e5343dea420b4a75df82c676dceda..970c665f976a908737f1a48b26546287f12f11cf 100644
--- a/chrome/browser/ui/views/chrome_views_delegate.cc
+++ b/chrome/browser/ui/views/chrome_views_delegate.cc
@@ -21,6 +21,7 @@
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/browser/ui/browser_window_state.h"
+#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/harmony/harmony_layout_delegate.h"
#include "chrome/grit/chrome_unscaled_resources.h"
#include "components/prefs/pref_service.h"
@@ -446,24 +447,27 @@ void ChromeViewsDelegate::OnBeforeWidgetInit(
<< "Please provide a parent or context for this widget.";
if (!params->parent && !params->context)
params->context = ash::Shell::GetPrimaryRootWindow();
-#elif defined(USE_AURA)
+#elif defined(OS_LINUX) && !defined(OS_CHROMEOS)
sky 2017/02/16 22:10:32 Won't this break windows? By that I mean windows n
Tom (Use chromium acct) 2017/02/17 00:35:31 windows no longer hits this branch based on your
// 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) {
- params->native_widget = new views::DesktopNativeWidgetAura(delegate);
- } else if (use_non_toplevel_window) {
+ gfx::NativeWindow parent_or_context =
+ params->parent ? params->parent : params->context;
+ void* profile = nullptr;
+ const char* key = BrowserView::kThemeProfileKey;
+ if (parent_or_context)
+ profile = parent_or_context->GetNativeWindowProperty(key);
+ 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(key, profile);
+ } else {
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 {
- params->native_widget = new views::DesktopNativeWidgetAura(delegate);
+ native_widget->SetNativeWindowProperty(key, profile);
}
#endif
}

Powered by Google App Engine
This is Rietveld 408576698