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

Side by Side Diff: chrome/browser/themes/theme_service_factory.cc

Issue 14141006: [components] Switch {RefCounted}ProfileKeyedService to use BrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698