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 3fd21e6a724e087da8265b2c2ab77eeead9164f5..241d2379a4c9ef0bc0d3d67e85d21269c51d6322 100644 |
--- a/chrome/browser/extensions/api/commands/command_service.cc |
+++ b/chrome/browser/extensions/api/commands/command_service.cc |
@@ -351,6 +351,7 @@ Command CommandService::FindCommandByName(const std::string& extension_id, |
std::string extension; |
item->GetString(kExtension, &extension); |
+ |
Finnur
2014/10/22 09:43:03
nit: This line break seems to be breaking up code
|
if (extension != extension_id) |
continue; |
std::string command_name; |
@@ -550,9 +551,14 @@ void CommandService::AssignKeybindings(const Extension* extension) { |
bool CommandService::CanAutoAssign(const Command &command, |
const Extension* extension) { |
- // Media Keys are non-exclusive, so allow auto-assigning them. |
- if (Command::IsMediaKey(command.accelerator())) |
+ |
Finnur
2014/10/22 09:43:03
Don't add line breaks at the start of a function.
|
+ // Media Keys are non-exclusive, so allow auto-assigning them if the user |
+ // has not changed them for the current extension. |
+ if (Command::IsMediaKey(command.accelerator())) { |
+ if (IsCommandShortcutUserModified(extension, command.command_name())) |
+ return false; |
return true; |
Finnur
2014/10/22 09:43:03
nit: Prefer:
return !foo();
over
if (foo())
|
+ } |
// Extensions are allowed to auto-assign updated keys if the user has not |
// changed from the previous value. |