| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_BROWSER_COCOA_SYSTEM_HOTKEY_MAP_H_ | 5 #ifndef CONTENT_BROWSER_COCOA_SYSTEM_HOTKEY_MAP_H_ |
| 6 #define CONTENT_BROWSER_COCOA_SYSTEM_HOTKEY_MAP_H_ | 6 #define CONTENT_BROWSER_COCOA_SYSTEM_HOTKEY_MAP_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 // Can be called multiple times. Only the results from the most recent | 34 // Can be called multiple times. Only the results from the most recent |
| 35 // invocation are stored. | 35 // invocation are stored. |
| 36 bool ParseDictionary(NSDictionary* dictionary); | 36 bool ParseDictionary(NSDictionary* dictionary); |
| 37 | 37 |
| 38 // Whether the event corresponds to a hotkey that has been reserved by the | 38 // Whether the event corresponds to a hotkey that has been reserved by the |
| 39 // system. | 39 // system. |
| 40 bool IsEventReserved(NSEvent* event) const; | 40 bool IsEventReserved(NSEvent* event) const; |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 FRIEND_TEST_ALL_PREFIXES(SystemHotkeyMapTest, Parse); | 43 FRIEND_TEST_ALL_PREFIXES(SystemHotkeyMapTest, Parse); |
| 44 FRIEND_TEST_ALL_PREFIXES(SystemHotkeyMapTest, ParseMouse); |
| 44 | 45 |
| 45 // Whether the hotkey has been reserved by the user. | 46 // Whether the hotkey has been reserved by the user. |
| 46 bool IsHotkeyReserved(int key_code, int modifiers) const; | 47 bool IsHotkeyReserved(unsigned short key_code, NSUInteger modifiers) const; |
| 47 | 48 |
| 48 // Create at least one record of a hotkey that is reserved by the user. | 49 // Create at least one record of a hotkey that is reserved by the user. |
| 49 // Certain system hotkeys automatically reserve multiple key combinations. | 50 // Certain system hotkeys automatically reserve multiple key combinations. |
| 50 void ReserveHotkey(int key_code, int modifiers, NSString* system_effect); | 51 void ReserveHotkey(unsigned short key_code, |
| 52 NSUInteger modifiers, |
| 53 NSString* system_effect); |
| 51 | 54 |
| 52 // Create a record of a hotkey that is reserved by the user. | 55 // Create a record of a hotkey that is reserved by the user. |
| 53 void ReserveHotkey(int key_code, int modifiers); | 56 void ReserveHotkey(unsigned short key_code, NSUInteger modifiers); |
| 54 | 57 |
| 55 std::vector<SystemHotkey> system_hotkeys_; | 58 std::vector<SystemHotkey> system_hotkeys_; |
| 56 | 59 |
| 57 DISALLOW_COPY_AND_ASSIGN(SystemHotkeyMap); | 60 DISALLOW_COPY_AND_ASSIGN(SystemHotkeyMap); |
| 58 }; | 61 }; |
| 59 | 62 |
| 60 } // namespace content | 63 } // namespace content |
| 61 | 64 |
| 62 #endif // CONTENT_BROWSER_COCOA_SYSTEM_HOTKEY_MAP_H_ | 65 #endif // CONTENT_BROWSER_COCOA_SYSTEM_HOTKEY_MAP_H_ |
| OLD | NEW |