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

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

Issue 23445013: Parse media keys for named command in the manifest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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_new.cc
diff --git a/chrome/browser/extensions/api/commands/command_service_new.cc b/chrome/browser/extensions/api/commands/command_service_new.cc
index 296180fb4fe288b536475181a010f055532c4061..1a26f18e51e779bd79d2258580bf65431b5d4078 100644
--- a/chrome/browser/extensions/api/commands/command_service_new.cc
+++ b/chrome/browser/extensions/api/commands/command_service_new.cc
@@ -15,6 +15,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/common/extensions/api/commands/commands_handler.h"
#include "chrome/common/pref_names.h"
#include "components/user_prefs/pref_registry_syncable.h"
#include "content/public/browser/notification_details.h"
@@ -192,7 +193,8 @@ void CommandService::UpdateKeybindingPrefs(const std::string& extension_id,
// shortcut before proceeding.
RemoveKeybindingPrefs(extension_id, command_name);
- ui::Accelerator accelerator = Command::StringToAccelerator(keystroke);
+ ui::Accelerator accelerator =
+ Command::StringToAccelerator(keystroke, command_name);
AddKeybindingPref(accelerator, extension_id, command_name, true);
}
@@ -218,7 +220,7 @@ ui::Accelerator CommandService::FindShortcutForCommand(
if (StartsWithASCII(shortcut, Command::CommandPlatform() + ":", true))
shortcut = shortcut.substr(Command::CommandPlatform().length() + 1);
- return Command::StringToAccelerator(shortcut);
+ return Command::StringToAccelerator(shortcut, command_name);
}
return ui::Accelerator();

Powered by Google App Engine
This is Rietveld 408576698