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

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: Created 6 years, 5 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 | content/browser/renderer_host/native_web_keyboard_event.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..100b4fc67e83482537b59336b655e5c7b54041f6 100644
--- a/chrome/browser/extensions/api/commands/command_service.cc
+++ b/chrome/browser/extensions/api/commands/command_service.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/accelerator_utils.h"
#include "chrome/common/extensions/api/commands/commands_handler.h"
+#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/manifest_handlers/ui_overrides_handler.h"
#include "chrome/common/pref_names.h"
#include "components/pref_registry/pref_registry_syncable.h"
@@ -564,6 +565,10 @@ 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->id() == extension_misc::kChromeVoxExtensionId) {
+ return true;
+ }
Finnur 2014/07/17 11:00:52 This seems a bit hacky. We already have a permissi
David Tseng 2014/07/18 22:54:50 Are you referring to _permission_features(.json)?
Finnur 2014/08/11 14:01:07 Yes, for example, you can check in code whether an
David Tseng 2014/08/19 22:47:49 A few cases. Suppose focus (in Chrome OS) is on th
Finnur 2014/08/20 12:41:14 OK, then that's definitely something you'd want to
+
// Global shortcuts are restricted to (Ctrl|Command)+Shift+[0-9].
#if defined OS_MACOSX
if (!command.accelerator().IsCmdDown())
« no previous file with comments | « no previous file | content/browser/renderer_host/native_web_keyboard_event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698