Chromium Code Reviews| Index: chrome/common/extensions/command.cc |
| diff --git a/chrome/common/extensions/command.cc b/chrome/common/extensions/command.cc |
| index 8a07d95f566ea3950eeabc34bea547294cf17c7a..ff58db820e62876118f998aff6387ad436c35f82 100644 |
| --- a/chrome/common/extensions/command.cc |
| +++ b/chrome/common/extensions/command.cc |
| @@ -28,6 +28,12 @@ static const char kMissing[] = "Missing"; |
| static const char kCommandKeyNotSupported[] = |
| "Command key is not supported. Note: Ctrl means Command on Mac"; |
| +#if defined(OS_CHROMEOS) |
| +static const int kMaxTokenSize = 4; |
|
Finnur
2014/10/30 10:04:06
Nit: I'd comment this with:
// ChromeOS supports a
David Tseng
2014/10/30 17:01:46
Done.
|
| +#else |
| +static const int kMaxTokenSize = 3; |
| +#endif // OS_CHROMEOS |
| + |
| bool IsNamedCommand(const std::string& command_name) { |
| return command_name != values::kPageActionCommandEvent && |
| command_name != values::kBrowserActionCommandEvent; |
| @@ -62,7 +68,7 @@ ui::Accelerator ParseImpl(const std::string& accelerator, |
| base::SplitString(accelerator, '+', &tokens); |
| if (tokens.size() == 0 || |
| (tokens.size() == 1 && DoesRequireModifier(accelerator)) || |
| - tokens.size() > 3) { |
| + tokens.size() > kMaxTokenSize) { |
| *error = ErrorUtils::FormatErrorMessageUTF16( |
| errors::kInvalidKeyBinding, |
| base::IntToString(index), |