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

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

Issue 965233002: Remove deprecated extension notification from theme_service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove ExtensionRegistryObserver and Call from ExtensionService instead. Created 5 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
Index: chrome/browser/themes/theme_service.h
diff --git a/chrome/browser/themes/theme_service.h b/chrome/browser/themes/theme_service.h
index b70fd74c3cdb19ec7b8f273e11b1dbbd4532cba1..94ea270c136a3b7c6b8ef06168b24b7d084c16cf 100644
--- a/chrome/browser/themes/theme_service.h
+++ b/chrome/browser/themes/theme_service.h
@@ -61,6 +61,20 @@ class ThemeService : public base::NonThreadSafe,
public KeyedService,
public ui::ThemeProvider {
public:
+ // Receive notification when extension will be installed, loaded, unloaded.
+ class ExtensionObserver {
Lei Zhang 2015/03/10 19:25:52 This class needs to: - inherit from extensions::E
+ public:
+ explicit ExtensionObserver(ThemeService& service);
+ ~ExtensionObserver();
+ void OnExtensionWillBeInstalled(const extensions::Extension* extension);
+ void OnExtensionLoaded(const extensions::Extension* extension);
+ // Not be called when reason is REASON_LOCK_ALL or REASON_UPDATED.
+ void OnExtensionUnloaded(const extensions::Extension* extension);
+
+ private:
+ ThemeService& theme_service_;
+ };
+
// Public constants used in ThemeService and its subclasses:
static const char* kDefaultThemeID;
@@ -138,6 +152,8 @@ class ThemeService : public base::NonThreadSafe,
// owned by |this| object.
virtual ThemeSyncableService* GetThemeSyncableService() const;
+ ExtensionObserver extension_observer() const;
+
// Save the images to be written to disk, mapping file path to id.
typedef std::map<base::FilePath, int> ImagesDiskCache;
@@ -248,6 +264,8 @@ class ThemeService : public base::NonThreadSafe,
scoped_ptr<ThemeSyncableService> theme_syncable_service_;
+ ExtensionObserver extension_observer_;
+
base::WeakPtrFactory<ThemeService> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(ThemeService);

Powered by Google App Engine
This is Rietveld 408576698