Chromium Code Reviews| 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; |
| + } |
|
Finnur
2013/11/18 11:16:14
I presume we'll need this in other platform-specif
zhchbin
2013/11/18 13:10:13
Done. Have added to the linux implementation.
|
| + |
| int modifiers = 0; |
| modifiers |= accelerator.IsShiftDown() ? MOD_SHIFT : 0; |
| modifiers |= accelerator.IsCtrlDown() ? MOD_CONTROL : 0; |