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

Unified Diff: chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.cc

Issue 1690443002: Linux - fix native theme selection during theme changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: the indentation was too damn high Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.cc
diff --git a/chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.cc b/chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.cc
index 15b2cfeb8069969da72b422e5cad997075b02c82..15bdde0ee10392c4cb32389a9e461a877bf9986e 100644
--- a/chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.cc
+++ b/chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.cc
@@ -61,23 +61,21 @@ ui::NativeTheme* GetNativeThemeForWindow(aura::Window* window) {
window->GetNativeWindowProperty(Profile::kProfileKey));
}
- if (profile) {
- ThemeService* ts = ThemeServiceFactory::GetForProfile(profile);
- // If using the system (GTK) theme, don't use an Aura NativeTheme at all.
- if (!ts->UsingSystemTheme()) {
- // Use a dark theme for incognito browser windows that aren't
- // custom-themed. Otherwise, normal Aura theme.
- if (profile->GetProfileType() == Profile::INCOGNITO_PROFILE &&
- ts->UsingDefaultTheme() &&
- BrowserView::GetBrowserViewForNativeWindow(window)) {
- return ui::NativeThemeDarkAura::instance();
- }
-
- return ui::NativeThemeAura::instance();
- }
+ // If using the system (GTK) theme, don't use an Aura NativeTheme at all.
+ // NB: ThemeService::UsingSystemTheme() might lag behind this pref. See
+ // http://crbug.com/585522
+ if (!profile || profile->GetPrefs()->GetBoolean(prefs::kUsesSystemTheme))
+ return nullptr;
+
+ // Use a dark theme for incognito browser windows that aren't
+ // custom-themed. Otherwise, normal Aura theme.
+ if (profile->GetProfileType() == Profile::INCOGNITO_PROFILE &&
+ ThemeServiceFactory::GetForProfile(profile)->UsingDefaultTheme() &&
+ BrowserView::GetBrowserViewForNativeWindow(window)) {
+ return ui::NativeThemeDarkAura::instance();
}
- return nullptr;
+ return ui::NativeThemeAura::instance();
}
#endif
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698