| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/themes/theme_service_factory.h" | 5 #include "chrome/browser/themes/theme_service_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/prefs/pref_registry_syncable.h" |
| 9 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/profiles/profile_dependency_manager.h" | 12 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 12 #include "chrome/browser/themes/theme_service.h" | 13 #include "chrome/browser/themes/theme_service.h" |
| 13 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
| 14 | 15 |
| 15 #if defined(TOOLKIT_GTK) | 16 #if defined(TOOLKIT_GTK) |
| 16 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 17 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
| 17 #endif | 18 #endif |
| 18 | 19 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 49 #if defined(TOOLKIT_GTK) | 50 #if defined(TOOLKIT_GTK) |
| 50 provider = new GtkThemeService; | 51 provider = new GtkThemeService; |
| 51 #else | 52 #else |
| 52 provider = new ThemeService; | 53 provider = new ThemeService; |
| 53 #endif | 54 #endif |
| 54 provider->Init(profile); | 55 provider->Init(profile); |
| 55 | 56 |
| 56 return provider; | 57 return provider; |
| 57 } | 58 } |
| 58 | 59 |
| 59 void ThemeServiceFactory::RegisterUserPrefs(PrefServiceSyncable* prefs) { | 60 void ThemeServiceFactory::RegisterUserPrefs(PrefRegistrySyncable* registry) { |
| 60 #if defined(TOOLKIT_GTK) | 61 #if defined(TOOLKIT_GTK) |
| 61 prefs->RegisterBooleanPref(prefs::kUsesSystemTheme, | 62 registry->RegisterBooleanPref(prefs::kUsesSystemTheme, |
| 62 GtkThemeService::DefaultUsesSystemTheme(), | 63 GtkThemeService::DefaultUsesSystemTheme(), |
| 63 PrefServiceSyncable::UNSYNCABLE_PREF); | 64 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 64 #endif | 65 #endif |
| 65 prefs->RegisterFilePathPref(prefs::kCurrentThemePackFilename, | 66 registry->RegisterFilePathPref(prefs::kCurrentThemePackFilename, |
| 66 FilePath(), | 67 FilePath(), |
| 67 PrefServiceSyncable::UNSYNCABLE_PREF); | 68 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 68 prefs->RegisterStringPref(prefs::kCurrentThemeID, | 69 registry->RegisterStringPref(prefs::kCurrentThemeID, |
| 69 ThemeService::kDefaultThemeID, | 70 ThemeService::kDefaultThemeID, |
| 70 PrefServiceSyncable::UNSYNCABLE_PREF); | 71 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 71 prefs->RegisterDictionaryPref(prefs::kCurrentThemeImages, | 72 registry->RegisterDictionaryPref(prefs::kCurrentThemeImages, |
| 72 PrefServiceSyncable::UNSYNCABLE_PREF); | 73 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 73 prefs->RegisterDictionaryPref(prefs::kCurrentThemeColors, | 74 registry->RegisterDictionaryPref(prefs::kCurrentThemeColors, |
| 74 PrefServiceSyncable::UNSYNCABLE_PREF); | 75 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 75 prefs->RegisterDictionaryPref(prefs::kCurrentThemeTints, | 76 registry->RegisterDictionaryPref(prefs::kCurrentThemeTints, |
| 76 PrefServiceSyncable::UNSYNCABLE_PREF); | 77 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 77 prefs->RegisterDictionaryPref(prefs::kCurrentThemeDisplayProperties, | 78 registry->RegisterDictionaryPref(prefs::kCurrentThemeDisplayProperties, |
| 78 PrefServiceSyncable::UNSYNCABLE_PREF); | 79 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 79 } | 80 } |
| 80 | 81 |
| 81 bool ThemeServiceFactory::ServiceRedirectedInIncognito() const { | 82 bool ThemeServiceFactory::ServiceRedirectedInIncognito() const { |
| 82 return true; | 83 return true; |
| 83 } | 84 } |
| OLD | NEW |