Index: chrome/browser/ui/webui/extensions/command_handler.h |
diff --git a/chrome/browser/ui/webui/extensions/command_handler.h b/chrome/browser/ui/webui/extensions/command_handler.h |
index c2f557385703450a05fc6de5dd0c0f6112d1e391..817cced6870ce8ad5cb8f5206dc7e85d35f1354c 100644 |
--- a/chrome/browser/ui/webui/extensions/command_handler.h |
+++ b/chrome/browser/ui/webui/extensions/command_handler.h |
@@ -5,10 +5,10 @@ |
#ifndef CHROME_BROWSER_UI_WEBUI_EXTENSIONS_COMMAND_HANDLER_H_ |
#define CHROME_BROWSER_UI_WEBUI_EXTENSIONS_COMMAND_HANDLER_H_ |
+#include "base/scoped_observer.h" |
#include "base/compiler_specific.h" |
-#include "content/public/browser/notification_observer.h" |
-#include "content/public/browser/notification_registrar.h" |
#include "content/public/browser/web_ui_message_handler.h" |
+#include "extensions/browser/extension_registry_observer.h" |
namespace base { |
class DictionaryValue; |
@@ -22,6 +22,7 @@ class WebUIDataSource; |
namespace extensions { |
class Command; |
class CommandService; |
+class ExtensionRegistry; |
} |
class Extension; |
@@ -31,7 +32,7 @@ namespace extensions { |
// The handler page for the Extension Commands UI overlay. |
class CommandHandler : public content::WebUIMessageHandler, |
- public content::NotificationObserver { |
+ public extensions::ExtensionRegistryObserver { |
public: |
explicit CommandHandler(Profile* profile); |
virtual ~CommandHandler(); |
@@ -42,12 +43,16 @@ class CommandHandler : public content::WebUIMessageHandler, |
// WebUIMessageHandler implementation. |
virtual void RegisterMessages() OVERRIDE; |
- // NotificationObserver implementation. |
- virtual void Observe(int type, |
- const content::NotificationSource& source, |
- const content::NotificationDetails& details) OVERRIDE; |
- |
private: |
+ // extension::ExtensionRegistryObserver implementation. |
Devlin
2014/05/16 17:34:04
nit: extensions::
|
+ 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; |
+ |
// Update the list of extension commands in the config UI. |
void UpdateCommandDataOnPage(); |
@@ -72,10 +77,12 @@ class CommandHandler : public content::WebUIMessageHandler, |
// |commands|. |
void GetAllCommands(base::DictionaryValue* commands); |
- content::NotificationRegistrar registrar_; |
- |
Profile* profile_; |
+ ScopedObserver<extensions::ExtensionRegistry, |
+ extensions::ExtensionRegistryObserver> |
+ extension_registry_observer_; |
+ |
DISALLOW_COPY_AND_ASSIGN(CommandHandler); |
}; |