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

Side by Side Diff: content/browser/cocoa/system_hotkey_map.h

Issue 408973002: mac: Load the system hotkeys after launch. (reland) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't parse mouse hotkeys as keyboard hotkeys. Created 6 years, 5 months 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 unified diff | Download patch
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « no previous file | content/browser/cocoa/system_hotkey_map.mm » ('j') | content/browser/cocoa/system_hotkey_map_unittest.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698