Chromium Code Reviews| Index: extensions/browser/extension_registry.h |
| diff --git a/extensions/browser/extension_registry.h b/extensions/browser/extension_registry.h |
| index d878e61e84db8ec44e56741cad14925dd997c038..5a70cde37005f9407c7e3f6b1dc0fa35b614d7eb 100644 |
| --- a/extensions/browser/extension_registry.h |
| +++ b/extensions/browser/extension_registry.h |
| @@ -9,6 +9,7 @@ |
| #include "base/compiler_specific.h" |
| #include "base/memory/ref_counted.h" |
| +#include "base/observer_list.h" |
| #include "components/browser_context_keyed_service/browser_context_keyed_service.h" |
| #include "extensions/common/extension_set.h" |
| @@ -18,6 +19,7 @@ class BrowserContext; |
| namespace extensions { |
| class Extension; |
| +class ExtensionRegistryObserver; |
| // ExtensionRegistry holds sets of the installed extensions for a given |
| // BrowserContext. An incognito browser context and its master browser context |
| @@ -55,6 +57,18 @@ class ExtensionRegistry : public BrowserContextKeyedService { |
| return blacklisted_extensions_; |
| } |
| + // The usual observer interface. |
|
not at google - send to devlin
2014/01/22 16:17:43
[musing]
One nice thing about explicit dependenci
|
| + void AddObserver(ExtensionRegistryObserver* observer); |
| + void RemoveObserver(ExtensionRegistryObserver* observer); |
| + |
| + // Invokes the observer method OnExtensionUnloaded(). The extension must not |
| + // be enabled at the time of the call. |
| + void TriggerOnUnloaded(const Extension* extension); |
|
not at google - send to devlin
2014/01/22 16:17:43
It looks like the notification also has an "unload
James Cook
2014/01/22 17:41:52
I don't understand what you mean by "might as well
not at google - send to devlin
2014/01/22 17:49:07
Up to you, I don't feel one way or the other, just
|
| + |
| + // Invokes the observer method OnExtensionDisabled(). The extension must be |
| + // disabled at the time of the call. |
| + void TriggerOnDisabled(const Extension* extension); |
|
not at google - send to devlin
2014/01/22 16:17:43
It's interesting; there's no disabled notification
James Cook
2014/01/22 17:41:52
I agree it looks odd.
not at google - send to devlin
2014/01/22 17:49:07
I meant that it seems like we should clear all of
|
| + |
| // Find an extension by ID using |include_mask| to pick the sets to search: |
| // * enabled_extensions() --> ExtensionRegistry::ENABLED |
| // * disabled_extensions() --> ExtensionRegistry::DISABLED |
| @@ -117,6 +131,8 @@ class ExtensionRegistry : public BrowserContextKeyedService { |
| // un-blacklisted. |
| ExtensionSet blacklisted_extensions_; |
| + ObserverList<ExtensionRegistryObserver> observers_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(ExtensionRegistry); |
| }; |