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 |