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

Unified Diff: chrome/browser/extensions/api/commands/command_service.cc

Issue 10701005: Extension Commands changed by the user now take effect immediately. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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/extensions/api/commands/command_service.cc
===================================================================
--- chrome/browser/extensions/api/commands/command_service.cc (revision 144430)
+++ chrome/browser/extensions/api/commands/command_service.cc (working copy)
@@ -14,6 +14,7 @@
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/pref_names.h"
+#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
using extensions::Extension;
@@ -120,6 +121,15 @@
keybinding->SetString(kCommandName, command_name);
bindings->Set(key, keybinding);
+
+ std::pair<const std::string, const std::string> details =
+ std::make_pair(extension_id, command_name);
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_EXTENSION_COMMAND_ADDED,
+ content::Source<Profile>(profile_),
+ content::Details<
+ std::pair<const std::string, const std::string> >(&details));
+
return true;
}
@@ -243,7 +253,16 @@
for (KeysToRemove::const_iterator it = keys_to_remove.begin();
it != keys_to_remove.end(); ++it) {
- bindings->Remove(*it, NULL);
+ std::string key = *it;
+ bindings->Remove(key, NULL);
+
+ std::pair<const std::string, const std::string> details =
+ std::make_pair(extension_id, command_name);
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_EXTENSION_COMMAND_REMOVED,
+ content::Source<Profile>(profile_),
+ content::Details<
+ std::pair<const std::string, const std::string> >(&details));
}
}

Powered by Google App Engine
This is Rietveld 408576698