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

Unified Diff: chrome/browser/ui/gtk/location_bar_view_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/location_bar_view_gtk.cc
===================================================================
--- chrome/browser/ui/gtk/location_bar_view_gtk.cc (revision 129600)
+++ chrome/browser/ui/gtk/location_bar_view_gtk.cc (working copy)
@@ -1709,21 +1709,15 @@
extensions->GetByID(page_action_->extension_id());
window_ = owner_->browser()->window()->GetNativeHandle();
- // 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)
- continue;
-
+ const Extension::ExtensionKeybinding* command =
+ extension->page_action_command();
+ if (command) {
// Found the browser action shortcut command, register it.
keybinding_.reset(new ui::AcceleratorGtk(
- commands[i].accelerator().key_code(),
- commands[i].accelerator().IsShiftDown(),
- commands[i].accelerator().IsCtrlDown(),
- commands[i].accelerator().IsAltDown()));
+ command->accelerator().key_code(),
+ command->accelerator().IsShiftDown(),
+ command->accelerator().IsCtrlDown(),
+ command->accelerator().IsAltDown()));
accel_group_ = gtk_accel_group_new();
gtk_window_add_accel_group(window_, accel_group_);
@@ -1740,7 +1734,6 @@
registrar_.Add(this,
chrome::NOTIFICATION_WINDOW_CLOSED,
content::Source<GtkWindow>(window_));
- break;
}
}

Powered by Google App Engine
This is Rietveld 408576698