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

Unified Diff: chrome/browser/extensions/api/commands/command_service.cc

Issue 667833004: Fix extension command service to check if user has modified key before overwrite on update. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code cleanup Created 6 years, 2 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
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..4987c2be870b983870ea4852aa92cdc24d8a2fe5 100644
--- a/chrome/browser/extensions/api/commands/command_service.cc
+++ b/chrome/browser/extensions/api/commands/command_service.cc
@@ -550,15 +550,15 @@ 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()))
- return true;
-
// Extensions are allowed to auto-assign updated keys if the user has not
// changed from the previous value.
if (IsCommandShortcutUserModified(extension, command.command_name()))
return false;
+ // Media Keys are non-exclusive, so allow auto-assigning them
Finnur 2014/10/23 09:09:54 nit: End your comments with some kind of punctuati
+ if (Command::IsMediaKey(command.accelerator()))
+ return true;
+
if (command.global()) {
using namespace extensions;
if (command.command_name() == manifest_values::kBrowserActionCommandEvent ||

Powered by Google App Engine
This is Rietveld 408576698