| Index: chrome/common/extensions/api/commands/commands_handler.cc
|
| diff --git a/chrome/common/extensions/api/commands/commands_handler.cc b/chrome/common/extensions/api/commands/commands_handler.cc
|
| index d49a1056240f4ad8f3c57c01532116b8c1eb1b25..8d0788b121ceacf37f640f0e2fb5da74e2b154c9 100644
|
| --- a/chrome/common/extensions/api/commands/commands_handler.cc
|
| +++ b/chrome/common/extensions/api/commands/commands_handler.cc
|
| @@ -7,6 +7,7 @@
|
| #include "base/strings/string_number_conversions.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| #include "base/values.h"
|
| +#include "chrome/common/extensions/command.h"
|
| #include "extensions/common/error_utils.h"
|
| #include "extensions/common/manifest_constants.h"
|
|
|
| @@ -90,7 +91,13 @@ bool CommandsHandler::Parse(Extension* extension, base::string16* error) {
|
| return false; // |error| already set.
|
|
|
| if (binding->accelerator().key_code() != ui::VKEY_UNKNOWN) {
|
| - if (++keybindings_found > kMaxCommandsWithKeybindingPerExtension) {
|
| + // Only media keys are allowed to work without modifiers, and because
|
| + // media keys aren't registered exclusively they should not count towards
|
| + // the max of four shortcuts per extension.
|
| + if (!Command::IsMediaKey(binding->accelerator()))
|
| + ++keybindings_found;
|
| +
|
| + if (keybindings_found > kMaxCommandsWithKeybindingPerExtension) {
|
| *error = ErrorUtils::FormatErrorMessageUTF16(
|
| manifest_errors::kInvalidKeyBindingTooMany,
|
| base::IntToString(kMaxCommandsWithKeybindingPerExtension));
|
|
|