OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_MAC_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_MAC_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_MAC_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_MAC_H_ |
7 | 7 |
8 #include "chrome/browser/extensions/global_shortcut_listener.h" | 8 #include "chrome/browser/extensions/global_shortcut_listener.h" |
9 | 9 |
10 #include <Carbon/Carbon.h> | 10 #include <Carbon/Carbon.h> |
(...skipping 23 matching lines...) Expand all Loading... |
34 typedef int KeyId; | 34 typedef int KeyId; |
35 typedef std::map<ui::Accelerator, KeyId> AcceleratorIdMap; | 35 typedef std::map<ui::Accelerator, KeyId> AcceleratorIdMap; |
36 typedef std::map<KeyId, ui::Accelerator> IdAcceleratorMap; | 36 typedef std::map<KeyId, ui::Accelerator> IdAcceleratorMap; |
37 typedef std::map<KeyId, EventHotKeyRef> IdHotKeyRefMap; | 37 typedef std::map<KeyId, EventHotKeyRef> IdHotKeyRefMap; |
38 | 38 |
39 // Keyboard event callbacks. | 39 // Keyboard event callbacks. |
40 void OnHotKeyEvent(EventHotKeyID hot_key_id); | 40 void OnHotKeyEvent(EventHotKeyID hot_key_id); |
41 bool OnMediaKeyEvent(int key_code); | 41 bool OnMediaKeyEvent(int key_code); |
42 | 42 |
43 // GlobalShortcutListener implementation. | 43 // GlobalShortcutListener implementation. |
44 virtual void StartListening() OVERRIDE; | 44 virtual void StartListening() override; |
45 virtual void StopListening() OVERRIDE; | 45 virtual void StopListening() override; |
46 virtual bool RegisterAcceleratorImpl( | 46 virtual bool RegisterAcceleratorImpl( |
47 const ui::Accelerator& accelerator) OVERRIDE; | 47 const ui::Accelerator& accelerator) override; |
48 virtual void UnregisterAcceleratorImpl( | 48 virtual void UnregisterAcceleratorImpl( |
49 const ui::Accelerator& accelerator) OVERRIDE; | 49 const ui::Accelerator& accelerator) override; |
50 | 50 |
51 // Mac-specific functions for registering hot keys with modifiers. | 51 // Mac-specific functions for registering hot keys with modifiers. |
52 bool RegisterHotKey(const ui::Accelerator& accelerator, KeyId hot_key_id); | 52 bool RegisterHotKey(const ui::Accelerator& accelerator, KeyId hot_key_id); |
53 void UnregisterHotKey(const ui::Accelerator& accelerator); | 53 void UnregisterHotKey(const ui::Accelerator& accelerator); |
54 | 54 |
55 // Enable and disable the media key event tap. | 55 // Enable and disable the media key event tap. |
56 void StartWatchingMediaKeys(); | 56 void StartWatchingMediaKeys(); |
57 void StopWatchingMediaKeys(); | 57 void StopWatchingMediaKeys(); |
58 | 58 |
59 // Enable and disable the hot key event handler. | 59 // Enable and disable the hot key event handler. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 // Event handler for keyboard shortcut hot keys. | 98 // Event handler for keyboard shortcut hot keys. |
99 EventHandlerRef event_handler_; | 99 EventHandlerRef event_handler_; |
100 | 100 |
101 DISALLOW_COPY_AND_ASSIGN(GlobalShortcutListenerMac); | 101 DISALLOW_COPY_AND_ASSIGN(GlobalShortcutListenerMac); |
102 }; | 102 }; |
103 | 103 |
104 } // namespace extensions | 104 } // namespace extensions |
105 | 105 |
106 #endif // CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_MAC_H_ | 106 #endif // CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_MAC_H_ |
OLD | NEW |