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

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: Fix the test case!! 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..318e06e11a3647f6d13c76995f0f104c3406a340 100644
--- a/chrome/browser/extensions/global_shortcut_listener_win.cc
+++ b/chrome/browser/extensions/global_shortcut_listener_win.cc
@@ -72,6 +72,13 @@ 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 already been registered. Some shortcuts, such as
+ // MediaKeys can 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