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

Unified Diff: chrome/browser/ui/views/browser_actions_container.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/views/browser_actions_container.cc
===================================================================
--- chrome/browser/ui/views/browser_actions_container.cc (revision 127690)
+++ chrome/browser/ui/views/browser_actions_container.cc (working copy)
@@ -116,18 +116,14 @@
UpdateState();
}
- // Iterate through all the keybindings and see if one is assigned to the
- // browserAction.
- const std::vector<Extension::ExtensionKeybinding>& commands =
- extension_->keybindings();
- for (size_t i = 0; i < commands.size(); ++i) {
- if (commands[i].command_name() ==
- extension_manifest_values::kBrowserActionKeybindingEvent) {
- keybinding_.reset(new ui::Accelerator(commands[i].accelerator()));
- panel_->GetFocusManager()->RegisterAccelerator(
- *keybinding_.get(), ui::AcceleratorManager::kHighPriority, this);
- break;
- }
+ std::vector<Extension::ExtensionKeybinding> browser_action_command;
+ extension_->GetCommandByType(Extension::ExtensionKeybinding::BROWSER_ACTION,
Aaron Boodman 2012/03/21 21:05:04 Can you change Extension to store these commands i
+ &browser_action_command);
+ if (!browser_action_command.empty()) {
+ Extension::ExtensionKeybinding* command = &browser_action_command[0];
+ keybinding_.reset(new ui::Accelerator(command->accelerator()));
+ panel_->GetFocusManager()->RegisterAccelerator(
+ *keybinding_.get(), ui::AcceleratorManager::kHighPriority, this);
}
}

Powered by Google App Engine
This is Rietveld 408576698