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

Unified Diff: chrome/browser/themes/theme_service_factory.cc

Issue 11416324: Revert changes to have ExtensionService notify ThemeService directly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/themes/theme_service_factory.h ('k') | chrome/browser/ui/gtk/gtk_theme_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
« no previous file with comments | « chrome/browser/themes/theme_service_factory.h ('k') | chrome/browser/ui/gtk/gtk_theme_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698