Chromium Code Reviews

Unified Diff: chrome/browser/extensions/api/commands/command_service.cc

Issue 60353008: Mac global keybindings (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: chrome/browser/extensions/api/commands/command_service.cc
===================================================================
--- chrome/browser/extensions/api/commands/command_service.cc (revision 239014)
+++ chrome/browser/extensions/api/commands/command_service.cc (working copy)
@@ -79,10 +79,17 @@
}
bool IsWhitelistedGlobalShortcut(const extensions::Command& command) {
+ // Non-global shortcuts are always allowed.
if (!command.global())
return true;
+ // Global shortcuts must be (Ctrl|Command)-Shift-[0-9].
+#if defined OS_MACOSX
+ if (!command.accelerator().IsCmdDown())
+ return false;
+#else
if (!command.accelerator().IsCtrlDown())
return false;
+#endif
if (!command.accelerator().IsShiftDown())
return false;
return (command.accelerator().key_code() >= ui::VKEY_0 &&

Powered by Google App Engine