Chromium Code Reviews| 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..72bc708855038cb1bea30b01e8883f2b63aeda53 100644 |
| --- a/chrome/browser/ui/webui/extensions/command_handler.h |
| +++ b/chrome/browser/ui/webui/extensions/command_handler.h |
| @@ -6,9 +6,9 @@ |
| #define CHROME_BROWSER_UI_WEBUI_EXTENSIONS_COMMAND_HANDLER_H_ |
| #include "base/compiler_specific.h" |
| -#include "content/public/browser/notification_observer.h" |
| -#include "content/public/browser/notification_registrar.h" |
| +#include "base/scoped_observer.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; |
|
Devlin
2014/05/19 16:04:11
These can be moved to around line 32, so we don't
limasdf
2014/05/20 04:04:49
Done.
|
| class CommandService; |
| +class ExtensionRegistry; |
| } |
| class Extension; |
|
Devlin
2014/05/19 16:04:11
This should be forward-declared in the extensions
limasdf
2014/05/20 04:04:49
Done.
|
| @@ -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: |
| + // extensions::ExtensionRegistryObserver implementation. |
| + virtual void OnExtensionLoaded( |
| + content::BrowserContext* browser_context, |
| + const extensions::Extension* extension) OVERRIDE; |
|
Devlin
2014/05/19 16:04:11
In extensions namespace, so don't need extensions:
limasdf
2014/05/20 04:04:49
Done.
|
| + 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); |
| }; |