Index: chrome/browser/ui/views/location_bar/page_action_image_view.cc |
=================================================================== |
--- chrome/browser/ui/views/location_bar/page_action_image_view.cc (revision 127690) |
+++ chrome/browser/ui/views/location_bar/page_action_image_view.cc (working copy) |
@@ -60,18 +60,14 @@ |
set_accessibility_focusable(true); |
- // Iterate through all the keybindings and see if one is assigned to the |
- // pageAction. |
- 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::kPageActionKeybindingEvent) { |
- keybinding_.reset(new ui::Accelerator(commands[i].accelerator())); |
- owner_->GetFocusManager()->RegisterAccelerator( |
- *keybinding_.get(), ui::AcceleratorManager::kHighPriority, this); |
- break; |
- } |
+ std::vector<Extension::ExtensionKeybinding> page_action_command; |
+ extension->GetCommandByType(Extension::ExtensionKeybinding::PAGE_ACTION, |
+ &page_action_command); |
+ if (!page_action_command.empty()) { |
+ Extension::ExtensionKeybinding* command = &page_action_command[0]; |
+ keybinding_.reset(new ui::Accelerator(command->accelerator())); |
+ owner_->GetFocusManager()->RegisterAccelerator( |
+ *keybinding_.get(), ui::AcceleratorManager::kHighPriority, this); |
} |
} |