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

Unified Diff: chrome/browser/themes/theme_service_factory.cc

Issue 17494005: linux_aura: Three fixes for switching themes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to tot Created 7 years, 6 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 | « chrome/browser/themes/theme_service_aurax11.cc ('k') | chrome/browser/ui/libgtk2ui/gtk2_ui.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/themes/theme_service_factory.cc
diff --git a/chrome/browser/themes/theme_service_factory.cc b/chrome/browser/themes/theme_service_factory.cc
index 054d56c34301768798bc8c9d43082fc2b7816366..adc424b7f7fdcba164f197018522ccfa6073a41a 100644
--- a/chrome/browser/themes/theme_service_factory.cc
+++ b/chrome/browser/themes/theme_service_factory.cc
@@ -18,6 +18,11 @@
#include "chrome/browser/ui/gtk/gtk_theme_service.h"
#endif
+#if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#include "chrome/browser/themes/theme_service_aurax11.h"
+#include "ui/linux_ui/linux_ui.h"
+#endif
+
// static
ThemeService* ThemeServiceFactory::GetForProfile(Profile* profile) {
return static_cast<ThemeService*>(
@@ -51,6 +56,8 @@ BrowserContextKeyedService* ThemeServiceFactory::BuildServiceInstanceFor(
ThemeService* provider = NULL;
#if defined(TOOLKIT_GTK)
provider = new GtkThemeService;
+#elif defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS)
+ provider = new ThemeServiceAuraX11;
#else
provider = new ThemeService;
#endif
@@ -61,10 +68,20 @@ BrowserContextKeyedService* ThemeServiceFactory::BuildServiceInstanceFor(
void ThemeServiceFactory::RegisterUserPrefs(
user_prefs::PrefRegistrySyncable* registry) {
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+ bool default_uses_system_theme = false;
+
#if defined(TOOLKIT_GTK)
+ default_uses_system_theme = GtkThemeService::DefaultUsesSystemTheme();
+#elif defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS)
+ const ui::LinuxUI* linux_ui = ui::LinuxUI::instance();
+ if (linux_ui)
+ default_uses_system_theme = linux_ui->GetDefaultUsesSystemTheme();
+#endif
+
registry->RegisterBooleanPref(
prefs::kUsesSystemTheme,
- GtkThemeService::DefaultUsesSystemTheme(),
+ default_uses_system_theme,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
#endif
registry->RegisterFilePathPref(
« no previous file with comments | « chrome/browser/themes/theme_service_aurax11.cc ('k') | chrome/browser/ui/libgtk2ui/gtk2_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698