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

Unified Diff: chrome/browser/ui/gtk/browser_actions_toolbar_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
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/extensions/extension_keybinding_registry_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc
===================================================================
--- chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc (revision 129600)
+++ chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc (working copy)
@@ -374,21 +374,15 @@
// Connect the accelerator for the browser action popup.
void ConnectBrowserActionPopupAccelerator() {
- // 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)
- continue;
-
+ const Extension::ExtensionKeybinding* command =
+ extension_->browser_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()));
gfx::NativeWindow window =
toolbar_->browser()->window()->GetNativeHandle();
@@ -407,7 +401,6 @@
registrar_.Add(this,
chrome::NOTIFICATION_WINDOW_CLOSED,
content::Source<GtkWindow>(window));
- break;
}
}
« no previous file with comments | « no previous file | chrome/browser/ui/gtk/extensions/extension_keybinding_registry_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698