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

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: No namespace 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..d6e4beca28799b43a13034144a469213dde48eca 100644
--- a/chrome/browser/ui/views/chrome_views_delegate.cc
+++ b/chrome/browser/ui/views/chrome_views_delegate.cc
@@ -50,6 +50,7 @@
#if defined(USE_AURA)
#include "chrome/browser/ui/aura/accessibility/automation_manager_aura.h"
+#include "chrome/browser/ui/views/theme_profile_key.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#endif
@@ -450,9 +451,19 @@ 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) {
- params->native_widget = new views::DesktopNativeWidgetAura(delegate);
- } else if (use_non_toplevel_window) {
+ gfx::NativeWindow parent_or_context =
+ params->parent ? params->parent : params->context;
+ Profile* profile = nullptr;
+ if (parent_or_context)
+ profile = GetThemeProfileForWindow(parent_or_context);
+ aura::Window* window = 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;
+ window = native_widget->GetNativeWindow();
+ } else {
views::NativeWidgetAura* native_widget =
new views::NativeWidgetAura(delegate);
if (params->parent) {
@@ -462,9 +473,9 @@ void ChromeViewsDelegate::OnBeforeWidgetInit(
parent_profile);
}
params->native_widget = native_widget;
- } else {
- params->native_widget = new views::DesktopNativeWidgetAura(delegate);
+ window = native_widget->GetNativeWindow();
}
+ SetThemeProfileForWindow(window, profile);
#endif
}
« no previous file with comments | « chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc ('k') | chrome/browser/ui/views/frame/browser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698