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

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

Issue 275503003: Remove deprecated extension notification and deprecated extension_service functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comment from xiyuan 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..8f6f14bdd38890174f7d9272d157ce1605b9ff20 100644
--- a/chrome/browser/ui/webui/extensions/command_handler.h
+++ b/chrome/browser/ui/webui/extensions/command_handler.h
@@ -6,9 +6,11 @@
#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"
+
+class Profile;
namespace base {
class DictionaryValue;
@@ -22,16 +24,12 @@ class WebUIDataSource;
namespace extensions {
class Command;
class CommandService;
-}
-
class Extension;
-class Profile;
-
-namespace extensions {
+class ExtensionRegistry;
// The handler page for the Extension Commands UI overlay.
class CommandHandler : public content::WebUIMessageHandler,
- public content::NotificationObserver {
+ public ExtensionRegistryObserver {
public:
explicit CommandHandler(Profile* profile);
virtual ~CommandHandler();
@@ -42,12 +40,15 @@ 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:
+ // ExtensionRegistryObserver implementation.
+ virtual void OnExtensionLoaded(content::BrowserContext* browser_context,
+ const Extension* extension) OVERRIDE;
+ virtual void OnExtensionUnloaded(
+ content::BrowserContext* browser_context,
+ const Extension* extension,
+ UnloadedExtensionInfo::Reason reason) OVERRIDE;
+
// Update the list of extension commands in the config UI.
void UpdateCommandDataOnPage();
@@ -72,10 +73,11 @@ class CommandHandler : public content::WebUIMessageHandler,
// |commands|.
void GetAllCommands(base::DictionaryValue* commands);
- content::NotificationRegistrar registrar_;
-
Profile* profile_;
+ ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver>
+ extension_registry_observer_;
+
DISALLOW_COPY_AND_ASSIGN(CommandHandler);
};
« no previous file with comments | « chrome/browser/ui/webui/app_list/start_page_handler.cc ('k') | chrome/browser/ui/webui/extensions/command_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698