| 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 "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "chrome/browser/profiles/incognito_helpers.h" | 9 #include "chrome/browser/profiles/incognito_helpers.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 user_prefs::PrefRegistrySyncable* registry) { | 68 user_prefs::PrefRegistrySyncable* registry) { |
| 69 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 69 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
| 70 bool default_uses_system_theme = false; | 70 bool default_uses_system_theme = false; |
| 71 | 71 |
| 72 #if defined(USE_AURA) && defined(USE_X11) && !defined(OS_CHROMEOS) | 72 #if defined(USE_AURA) && defined(USE_X11) && !defined(OS_CHROMEOS) |
| 73 const views::LinuxUI* linux_ui = views::LinuxUI::instance(); | 73 const views::LinuxUI* linux_ui = views::LinuxUI::instance(); |
| 74 if (linux_ui) | 74 if (linux_ui) |
| 75 default_uses_system_theme = linux_ui->GetDefaultUsesSystemTheme(); | 75 default_uses_system_theme = linux_ui->GetDefaultUsesSystemTheme(); |
| 76 #endif | 76 #endif |
| 77 | 77 |
| 78 registry->RegisterBooleanPref( | 78 registry->RegisterBooleanPref(prefs::kUsesSystemTheme, |
| 79 prefs::kUsesSystemTheme, | 79 default_uses_system_theme); |
| 80 default_uses_system_theme, | |
| 81 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 82 #endif | 80 #endif |
| 83 registry->RegisterFilePathPref( | 81 registry->RegisterFilePathPref(prefs::kCurrentThemePackFilename, |
| 84 prefs::kCurrentThemePackFilename, | 82 base::FilePath()); |
| 85 base::FilePath(), | 83 registry->RegisterStringPref(prefs::kCurrentThemeID, |
| 86 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 84 ThemeService::kDefaultThemeID); |
| 87 registry->RegisterStringPref( | 85 registry->RegisterDictionaryPref(prefs::kCurrentThemeImages); |
| 88 prefs::kCurrentThemeID, | 86 registry->RegisterDictionaryPref(prefs::kCurrentThemeColors); |
| 89 ThemeService::kDefaultThemeID, | 87 registry->RegisterDictionaryPref(prefs::kCurrentThemeTints); |
| 90 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 88 registry->RegisterDictionaryPref(prefs::kCurrentThemeDisplayProperties); |
| 91 registry->RegisterDictionaryPref( | |
| 92 prefs::kCurrentThemeImages, | |
| 93 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 94 registry->RegisterDictionaryPref( | |
| 95 prefs::kCurrentThemeColors, | |
| 96 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 97 registry->RegisterDictionaryPref( | |
| 98 prefs::kCurrentThemeTints, | |
| 99 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 100 registry->RegisterDictionaryPref( | |
| 101 prefs::kCurrentThemeDisplayProperties, | |
| 102 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | |
| 103 } | 89 } |
| 104 | 90 |
| 105 content::BrowserContext* ThemeServiceFactory::GetBrowserContextToUse( | 91 content::BrowserContext* ThemeServiceFactory::GetBrowserContextToUse( |
| 106 content::BrowserContext* context) const { | 92 content::BrowserContext* context) const { |
| 107 return chrome::GetBrowserContextRedirectedInIncognito(context); | 93 return chrome::GetBrowserContextRedirectedInIncognito(context); |
| 108 } | 94 } |
| 109 | 95 |
| 110 bool ThemeServiceFactory::ServiceIsCreatedWithBrowserContext() const { | 96 bool ThemeServiceFactory::ServiceIsCreatedWithBrowserContext() const { |
| 111 return true; | 97 return true; |
| 112 } | 98 } |
| OLD | NEW |