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

Unified Diff: chrome/browser/ui/views/location_bar/page_action_image_view.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/location_bar/page_action_image_view.cc
===================================================================
--- chrome/browser/ui/views/location_bar/page_action_image_view.cc (revision 129600)
+++ chrome/browser/ui/views/location_bar/page_action_image_view.cc (working copy)
@@ -61,18 +61,12 @@
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;
- }
+ const Extension::ExtensionKeybinding* page_action_command =
+ extension->page_action_command();
+ if (page_action_command) {
+ keybinding_.reset(new ui::Accelerator(page_action_command->accelerator()));
+ owner_->GetFocusManager()->RegisterAccelerator(
+ *keybinding_.get(), ui::AcceleratorManager::kHighPriority, this);
}
}

Powered by Google App Engine
This is Rietveld 408576698