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

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

Issue 6766004: Create a ProfileDependencyManager to order ProfileKeyedService destruction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix improper usage of static_cast<> in existing mac code. Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/themes/theme_service.h ('k') | chrome/browser/themes/theme_service_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/themes/theme_service.cc
diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc
index 1731b47bbf9881445db31b9c9cf2b9ccc5dc49d7..3c4c3ff63b87859406d0262df87f679b00a904da 100644
--- a/chrome/browser/themes/theme_service.cc
+++ b/chrome/browser/themes/theme_service.cc
@@ -209,6 +209,10 @@ void ThemeService::Init(Profile* profile) {
DCHECK(CalledOnValidThread());
profile_ = profile;
+ registrar_.Add(this,
+ NotificationType::THEME_INSTALLED,
+ Source<Profile>(profile_));
+
LoadThemePrefs();
}
@@ -604,6 +608,14 @@ void ThemeService::FreePlatformCaches() {
}
#endif
+void ThemeService::Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details) {
+ DCHECK(type == NotificationType::THEME_INSTALLED);
+ const Extension* extension = Details<const Extension>(details).ptr();
+ SetTheme(extension);
+}
+
void ThemeService::SavePackName(const FilePath& pack_path) {
profile_->GetPrefs()->SetFilePath(
prefs::kCurrentThemePackFilename, pack_path);
« no previous file with comments | « chrome/browser/themes/theme_service.h ('k') | chrome/browser/themes/theme_service_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698