| 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/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 return Singleton<ThemeServiceFactory>::get(); | 38 return Singleton<ThemeServiceFactory>::get(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 ThemeServiceFactory::ThemeServiceFactory() | 41 ThemeServiceFactory::ThemeServiceFactory() |
| 42 : ProfileKeyedServiceFactory("ThemeService", | 42 : ProfileKeyedServiceFactory("ThemeService", |
| 43 ProfileDependencyManager::GetInstance()) {} | 43 ProfileDependencyManager::GetInstance()) {} |
| 44 | 44 |
| 45 ThemeServiceFactory::~ThemeServiceFactory() {} | 45 ThemeServiceFactory::~ThemeServiceFactory() {} |
| 46 | 46 |
| 47 ProfileKeyedService* ThemeServiceFactory::BuildServiceInstanceFor( | 47 ProfileKeyedService* ThemeServiceFactory::BuildServiceInstanceFor( |
| 48 Profile* profile) const { | 48 content::BrowserContext* profile) const { |
| 49 ThemeService* provider = NULL; | 49 ThemeService* provider = NULL; |
| 50 #if defined(TOOLKIT_GTK) | 50 #if defined(TOOLKIT_GTK) |
| 51 provider = new GtkThemeService; | 51 provider = new GtkThemeService; |
| 52 #else | 52 #else |
| 53 provider = new ThemeService; | 53 provider = new ThemeService; |
| 54 #endif | 54 #endif |
| 55 provider->Init(profile); | 55 provider->Init(static_cast<Profile*>(profile)); |
| 56 | 56 |
| 57 return provider; | 57 return provider; |
| 58 } | 58 } |
| 59 | 59 |
| 60 void ThemeServiceFactory::RegisterUserPrefs(PrefRegistrySyncable* registry) { | 60 void ThemeServiceFactory::RegisterUserPrefs(PrefRegistrySyncable* registry) { |
| 61 #if defined(TOOLKIT_GTK) | 61 #if defined(TOOLKIT_GTK) |
| 62 registry->RegisterBooleanPref(prefs::kUsesSystemTheme, | 62 registry->RegisterBooleanPref(prefs::kUsesSystemTheme, |
| 63 GtkThemeService::DefaultUsesSystemTheme(), | 63 GtkThemeService::DefaultUsesSystemTheme(), |
| 64 PrefRegistrySyncable::UNSYNCABLE_PREF); | 64 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 65 #endif | 65 #endif |
| (...skipping 13 matching lines...) Expand all Loading... |
| 79 PrefRegistrySyncable::UNSYNCABLE_PREF); | 79 PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 80 } | 80 } |
| 81 | 81 |
| 82 bool ThemeServiceFactory::ServiceRedirectedInIncognito() const { | 82 bool ThemeServiceFactory::ServiceRedirectedInIncognito() const { |
| 83 return true; | 83 return true; |
| 84 } | 84 } |
| 85 | 85 |
| 86 bool ThemeServiceFactory::ServiceIsCreatedWithProfile() const { | 86 bool ThemeServiceFactory::ServiceIsCreatedWithProfile() const { |
| 87 return true; | 87 return true; |
| 88 } | 88 } |
| OLD | NEW |