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 8992f1fa53f01d1c147d90088fc0c173b1a71d83..10a3b73fe7173ed21172fa5935cef1ac2b2c0ce4 100644 |
--- a/chrome/browser/themes/theme_service_factory.cc |
+++ b/chrome/browser/themes/theme_service_factory.cc |
@@ -19,27 +19,22 @@ |
// static |
ThemeService* ThemeServiceFactory::GetForProfile(Profile* profile) { |
return static_cast<ThemeService*>( |
- GetInstance()->GetServiceForProfile(profile, true /* create */)); |
+ GetInstance()->GetServiceForProfile(profile, true)); |
} |
// static |
-ThemeServiceFactory* ThemeServiceFactory::GetInstance() { |
- return Singleton<ThemeServiceFactory>::get(); |
+const extensions::Extension* ThemeServiceFactory::GetThemeForProfile( |
+ Profile* profile) { |
+ std::string id = GetForProfile(profile)->GetThemeID(); |
+ if (id == ThemeService::kDefaultThemeID) |
+ return NULL; |
+ |
+ return profile->GetExtensionService()->GetExtensionById(id, false); |
} |
// static |
-void ThemeServiceFactory::SetThemeForProfile( |
- Profile* profile, |
- const extensions::Extension* theme) { |
- ThemeService* theme_service = |
- static_cast<ThemeService*>( |
- GetInstance()->GetServiceForProfile(profile, false /* create */)); |
- if (theme_service) { |
- theme_service->SetTheme(theme); |
- } else { |
- // The theme service will pick up the new theme when it's created. |
- ThemeService::SaveThemeIDForProfile(profile, theme->id()); |
- } |
+ThemeServiceFactory* ThemeServiceFactory::GetInstance() { |
+ return Singleton<ThemeServiceFactory>::get(); |
} |
ThemeServiceFactory::ThemeServiceFactory() |