Index: chrome/browser/background/background_contents_service.h |
diff --git a/chrome/browser/background/background_contents_service.h b/chrome/browser/background/background_contents_service.h |
index 05f095330c3ddcad3bc528e909baf3b5890a8c29..d9f859de0ea0e5c0a1867f6e92af89f1e3faee3d 100644 |
--- a/chrome/browser/background/background_contents_service.h |
+++ b/chrome/browser/background/background_contents_service.h |
@@ -11,11 +11,13 @@ |
#include "base/gtest_prod_util.h" |
#include "base/memory/ref_counted.h" |
+#include "base/scoped_observer.h" |
#include "chrome/browser/tab_contents/background_contents.h" |
#include "components/keyed_service/core/keyed_service.h" |
#include "content/public/browser/notification_observer.h" |
#include "content/public/browser/notification_registrar.h" |
#include "content/public/common/window_container_type.h" |
+#include "extensions/browser/extension_registry_observer.h" |
#include "ui/base/window_open_disposition.h" |
#include "url/gurl.h" |
@@ -33,6 +35,7 @@ class SessionStorageNamespace; |
namespace extensions { |
class Extension; |
+class ExtensionRegistry; |
} |
namespace gfx { |
@@ -50,6 +53,7 @@ struct BackgroundContentsOpenedDetails; |
// BackgroundContents and their parent app, and shutting them down when the |
// parent app is unloaded. |
class BackgroundContentsService : private content::NotificationObserver, |
+ public extensions::ExtensionRegistryObserver, |
public BackgroundContents::Delegate, |
public KeyedService { |
public: |
@@ -140,6 +144,19 @@ class BackgroundContentsService : private content::NotificationObserver, |
const content::NotificationSource& source, |
const content::NotificationDetails& details) OVERRIDE; |
+ // extensions::ExtensionRegistryObserver implementation. |
+ virtual void OnExtensionLoaded( |
+ content::BrowserContext* browser_context, |
+ const extensions::Extension* extension) OVERRIDE; |
+ virtual void OnExtensionUnloaded( |
+ content::BrowserContext* browser_context, |
+ const extensions::Extension* extension, |
+ extensions::UnloadedExtensionInfo::Reason reason) OVERRIDE; |
+ virtual void OnExtensionUninstalled( |
+ content::BrowserContext* browser_context, |
+ const extensions::Extension* extension, |
+ extensions::UninstallReason reason) OVERRIDE; |
+ |
// Restarts a force-installed app/extension after a crash. |
void RestartForceInstalledExtensionOnCrash( |
const extensions::Extension* extension, |
@@ -218,6 +235,10 @@ class BackgroundContentsService : private content::NotificationObserver, |
BackgroundContentsMap; |
BackgroundContentsMap contents_map_; |
+ ScopedObserver<extensions::ExtensionRegistry, |
+ extensions::ExtensionRegistryObserver> |
+ extension_registry_observer_; |
+ |
DISALLOW_COPY_AND_ASSIGN(BackgroundContentsService); |
}; |