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

Unified Diff: chrome/browser/extensions/global_shortcut_listener_win.cc

Issue 64273008: [Windows] Finish global and non-global media keys support on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address some comments. Created 7 years, 1 month 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/global_shortcut_listener_win.cc
diff --git a/chrome/browser/extensions/global_shortcut_listener_win.cc b/chrome/browser/extensions/global_shortcut_listener_win.cc
index a5987f7ab9eca678c502dd225cbfb78170a760dc..acb2c2f0d28fc71da96c718b5659322d972f9b25 100644
--- a/chrome/browser/extensions/global_shortcut_listener_win.cc
+++ b/chrome/browser/extensions/global_shortcut_listener_win.cc
@@ -72,6 +72,12 @@ void GlobalShortcutListenerWin::OnWndProc(HWND hwnd,
void GlobalShortcutListenerWin::RegisterAccelerator(
const ui::Accelerator& accelerator,
GlobalShortcutListener::Observer* observer) {
+ if (hotkey_ids_.find(accelerator) != hotkey_ids_.end()) {
+ // The shortcut has been registered. Some shortcuts, such as MediaKeys can
Finnur 2013/11/13 10:22:24 nit: add the word 'already' in front of 'been'.
zhchbin 2013/11/13 16:05:11 Done.
+ // have multiple targets, all keyed off of the same accelerator.
+ return;
+ }
+
int modifiers = 0;
modifiers |= accelerator.IsShiftDown() ? MOD_SHIFT : 0;
modifiers |= accelerator.IsCtrlDown() ? MOD_CONTROL : 0;

Powered by Google App Engine
This is Rietveld 408576698