| 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 62a4b37a559d97befb075ab756b0aca0837ab118..74645d250b5284b050eeadcef1c0f3392b4b79db 100644
|
| --- a/chrome/browser/extensions/api/commands/command_service.cc
|
| +++ b/chrome/browser/extensions/api/commands/command_service.cc
|
| @@ -14,6 +14,7 @@
|
| #include "chrome/browser/extensions/extension_system.h"
|
| #include "chrome/browser/prefs/scoped_user_pref_update.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| +#include "chrome/browser/ui/accelerator_utils.h"
|
| #include "chrome/common/chrome_notification_types.h"
|
| #include "chrome/common/extensions/api/commands/commands_handler.h"
|
| #include "chrome/common/pref_names.h"
|
| @@ -232,37 +233,49 @@ void CommandService::AssignInitialKeybindings(const Extension* extension) {
|
|
|
| extensions::CommandMap::const_iterator iter = commands->begin();
|
| for (; iter != commands->end(); ++iter) {
|
| - AddKeybindingPref(iter->second.accelerator(),
|
| - extension->id(),
|
| - iter->second.command_name(),
|
| - false); // Overwriting not allowed.
|
| + if (!chrome::IsChromeAccelerator(
|
| + iter->second.accelerator(), profile_)) {
|
| + AddKeybindingPref(iter->second.accelerator(),
|
| + extension->id(),
|
| + iter->second.command_name(),
|
| + false); // Overwriting not allowed.
|
| + }
|
| }
|
|
|
| const extensions::Command* browser_action_command =
|
| CommandsInfo::GetBrowserActionCommand(extension);
|
| if (browser_action_command) {
|
| - AddKeybindingPref(browser_action_command->accelerator(),
|
| - extension->id(),
|
| - browser_action_command->command_name(),
|
| - false); // Overwriting not allowed.
|
| + if (!chrome::IsChromeAccelerator(
|
| + browser_action_command->accelerator(), profile_)) {
|
| + AddKeybindingPref(browser_action_command->accelerator(),
|
| + extension->id(),
|
| + browser_action_command->command_name(),
|
| + false); // Overwriting not allowed.
|
| + }
|
| }
|
|
|
| const extensions::Command* page_action_command =
|
| CommandsInfo::GetPageActionCommand(extension);
|
| if (page_action_command) {
|
| - AddKeybindingPref(page_action_command->accelerator(),
|
| - extension->id(),
|
| - page_action_command->command_name(),
|
| - false); // Overwriting not allowed.
|
| + if (!chrome::IsChromeAccelerator(
|
| + page_action_command->accelerator(), profile_)) {
|
| + AddKeybindingPref(page_action_command->accelerator(),
|
| + extension->id(),
|
| + page_action_command->command_name(),
|
| + false); // Overwriting not allowed.
|
| + }
|
| }
|
|
|
| const extensions::Command* script_badge_command =
|
| CommandsInfo::GetScriptBadgeCommand(extension);
|
| if (script_badge_command) {
|
| - AddKeybindingPref(script_badge_command->accelerator(),
|
| - extension->id(),
|
| - script_badge_command->command_name(),
|
| - false); // Overwriting not allowed.
|
| + if (!chrome::IsChromeAccelerator(
|
| + script_badge_command->accelerator(), profile_)) {
|
| + AddKeybindingPref(script_badge_command->accelerator(),
|
| + extension->id(),
|
| + script_badge_command->command_name(),
|
| + false); // Overwriting not allowed.
|
| + }
|
| }
|
| }
|
|
|
|
|