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

Unified Diff: chrome/browser/ui/webui/extensions/command_handler.h

Issue 280853004: Use EventRouter::Get instead of ExtensionSystem::Get(browser_context)->event_router() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 6 years, 7 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/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);
};

Powered by Google App Engine
This is Rietveld 408576698