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

Unified Diff: chrome/browser/ui/gtk/extensions/extension_keybinding_registry_gtk.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/ui/gtk/extensions/extension_keybinding_registry_gtk.cc
===================================================================
--- chrome/browser/ui/gtk/extensions/extension_keybinding_registry_gtk.cc (revision 144430)
+++ chrome/browser/ui/gtk/extensions/extension_keybinding_registry_gtk.cc (working copy)
@@ -54,7 +54,8 @@
}
void ExtensionKeybindingRegistryGtk::AddExtensionKeybinding(
- const extensions::Extension* extension) {
+ const extensions::Extension* extension,
+ const std::string& command_name) {
extensions::CommandService* command_service =
extensions::CommandServiceFactory::GetForProfile(profile_);
extensions::CommandMap commands;
@@ -67,6 +68,9 @@
extensions::CommandMap::const_iterator iter = commands.begin();
Evan Stade 2012/06/29 18:39:07 this should be inside the for statement
for (; iter != commands.end(); ++iter) {
+ if (!command_name.empty() && (iter->second.command_name() != command_name))
Yoyo Zhou 2012/06/28 22:40:51 Would it make any sense to do this instead in GetN
Finnur 2012/06/28 22:49:01 Maybe. I'll take a look tomorrow. If it does I mig
+ continue;
+
ui::AcceleratorGtk accelerator(iter->second.accelerator().key_code(),
iter->second.accelerator().IsShiftDown(),
iter->second.accelerator().IsCtrlDown(),
@@ -120,12 +124,14 @@
}
void ExtensionKeybindingRegistryGtk::RemoveExtensionKeybinding(
- const extensions::Extension* extension) {
+ const extensions::Extension* extension,
+ const std::string& command_name) {
EventTargets::iterator iter = event_targets_.begin();
while (iter != event_targets_.end()) {
- if (iter->second.first != extension->id()) {
+ if (iter->second.first != extension->id() ||
+ (!command_name.empty() && (iter->second.second != command_name))) {
Evan Stade 2012/06/29 18:39:07 don't need these parens around the != clause
++iter;
- continue; // Not the extension we asked for.
+ continue; // Not the extension or command we asked for.
}
// On GTK, unlike Windows, the Event Targets contain all events but we must

Powered by Google App Engine
This is Rietveld 408576698