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

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

Issue 399783002: Begin whitelisting specific extensions for global key registration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update cl with new permission "commands.accessibility". Created 6 years, 4 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/extensions/api/commands/command_service.cc
diff --git a/chrome/browser/extensions/api/commands/command_service.cc b/chrome/browser/extensions/api/commands/command_service.cc
index 3656f4b98830ca5dbfcde76a2b77127600157e38..ee11a07ca1a117c59f3dc1e429e9124bdfc65518 100644
--- a/chrome/browser/extensions/api/commands/command_service.cc
+++ b/chrome/browser/extensions/api/commands/command_service.cc
@@ -564,6 +564,11 @@ bool CommandService::CanAutoAssign(const Command &command,
command.command_name() == manifest_values::kPageActionCommandEvent)
return false; // Browser and page actions are not global in nature.
+ if (extension->permissions_data()->HasAPIPermission(
+ APIPermission::kCommandsAccessibility)) {
+ return true;
+ }
Finnur 2014/08/21 11:18:10 nit: No need for braces (single line if clause).
David Tseng 2014/08/21 16:17:56 Mixed on this one. The conditional is multiple lin
Finnur 2014/08/21 16:23:32 Yup. It is a common misunderstanding of the style
+
// Global shortcuts are restricted to (Ctrl|Command)+Shift+[0-9].
#if defined OS_MACOSX
if (!command.accelerator().IsCmdDown())

Powered by Google App Engine
This is Rietveld 408576698