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

Unified Diff: chrome/browser/ui/gtk/extensions/extension_keybinding_registry_gtk.cc

Issue 9812008: Polish the keybinding implementation a bit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 129600)
+++ chrome/browser/ui/gtk/extensions/extension_keybinding_registry_gtk.cc (working copy)
@@ -43,17 +43,17 @@
const Extension* extension) {
// Add all the keybindings (except pageAction and browserAction, which are
// handled elsewhere).
- const std::vector<Extension::ExtensionKeybinding> commands =
- extension->keybindings();
- for (size_t i = 0; i < commands.size(); ++i) {
- ui::AcceleratorGtk accelerator(commands[i].accelerator().key_code(),
- commands[i].accelerator().IsShiftDown(),
- commands[i].accelerator().IsCtrlDown(),
- commands[i].accelerator().IsAltDown());
+ const Extension::CommandMap& commands = extension->named_commands();
+ Extension::CommandMap::const_iterator iter = commands.begin();
+ for (; iter != commands.end(); ++iter) {
+ ui::AcceleratorGtk accelerator(iter->second.accelerator().key_code(),
+ iter->second.accelerator().IsShiftDown(),
+ iter->second.accelerator().IsCtrlDown(),
+ iter->second.accelerator().IsAltDown());
event_targets_[accelerator] =
- std::make_pair(extension->id(), commands[i].command_name());
+ std::make_pair(extension->id(), iter->second.command_name());
- if (ShouldIgnoreCommand(commands[i].command_name()))
+ if (ShouldIgnoreCommand(iter->second.command_name()))
continue;
if (!accel_group_) {
« no previous file with comments | « chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc ('k') | chrome/browser/ui/gtk/location_bar_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698