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

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

Issue 10870068: Make sure the Commands list correctly reflects the status of extensions right after install/uninsta… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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.cc
===================================================================
--- chrome/browser/ui/webui/extensions/command_handler.cc (revision 153186)
+++ chrome/browser/ui/webui/extensions/command_handler.cc (working copy)
@@ -12,6 +12,8 @@
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/browser_finder.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"
@@ -40,6 +42,13 @@
}
void CommandHandler::RegisterMessages() {
+ Browser* browser = browser::FindBrowserWithWebContents(
+ web_ui()->GetWebContents());
+ registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
+ content::Source<Profile>(browser->profile()));
+ registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED,
Yoyo Zhou 2012/08/24 16:00:40 You wrote install/uninstall in the CL description,
Finnur 2012/08/27 11:46:02 Changed to load/unload. On 2012/08/24 16:00:40, Y
+ content::Source<Profile>(browser->profile()));
+
web_ui()->RegisterMessageCallback("extensionCommandsRequestExtensionsData",
base::Bind(&CommandHandler::HandleRequestExtensionsData,
base::Unretained(this)));
@@ -51,6 +60,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_UNINSTALLED);
+ UpdateCommandDataOnPage();
+}
+
void CommandHandler::UpdateCommandDataOnPage() {
DictionaryValue results;
GetAllCommands(&results);

Powered by Google App Engine
This is Rietveld 408576698