| Index: chrome/browser/ui/webui/extensions/command_handler.cc
|
| ===================================================================
|
| --- chrome/browser/ui/webui/extensions/command_handler.cc (revision 153186)
|
| +++ chrome/browser/ui/webui/extensions/command_handler.cc (working copy)
|
| @@ -12,6 +12,7 @@
|
| #include "chrome/browser/extensions/extension_service.h"
|
| #include "chrome/browser/extensions/extension_system.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| +#include "chrome/common/chrome_notification_types.h"
|
| #include "chrome/common/extensions/extension_manifest_constants.h"
|
| #include "chrome/common/extensions/extension_set.h"
|
| #include "content/public/browser/web_ui.h"
|
| @@ -20,7 +21,7 @@
|
|
|
| namespace extensions {
|
|
|
| -CommandHandler::CommandHandler() {
|
| +CommandHandler::CommandHandler(Profile* profile) : profile_(profile) {
|
| }
|
|
|
| CommandHandler::~CommandHandler() {
|
| @@ -40,6 +41,11 @@
|
| }
|
|
|
| void CommandHandler::RegisterMessages() {
|
| + registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
|
| + content::Source<Profile>(profile_));
|
| + registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
|
| + content::Source<Profile>(profile_));
|
| +
|
| web_ui()->RegisterMessageCallback("extensionCommandsRequestExtensionsData",
|
| base::Bind(&CommandHandler::HandleRequestExtensionsData,
|
| base::Unretained(this)));
|
| @@ -51,6 +57,15 @@
|
| base::Unretained(this)));
|
| }
|
|
|
| +void CommandHandler::Observe(
|
| + int type,
|
| + const content::NotificationSource& source,
|
| + const content::NotificationDetails& details) {
|
| + DCHECK(type == chrome::NOTIFICATION_EXTENSION_LOADED ||
|
| + type == chrome::NOTIFICATION_EXTENSION_UNLOADED);
|
| + UpdateCommandDataOnPage();
|
| +}
|
| +
|
| void CommandHandler::UpdateCommandDataOnPage() {
|
| DictionaryValue results;
|
| GetAllCommands(&results);
|
|
|