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

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

Issue 370293004: mac: Load the system hotkeys after launch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments from rsesek, round 2. 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_COCOA_SYSTEM_HOTKEY_HELPER_MAC_H_
6 #define CONTENT_BROWSER_COCOA_SYSTEM_HOTKEY_HELPER_MAC_H_
7
8 #include "base/memory/singleton.h"
9 #include "base/memory/weak_ptr.h"
10
11 #ifdef __OBJC__
12 @class NSDictionary;
13 #else
14 class NSDictionary;
15 #endif
16
17 namespace content {
18
19 class SystemHotkeyMap;
20
21 class SystemHotkeyHelperMac {
Robert Sesek 2014/07/14 15:33:31 Every class needs a class-level comment.
erikchen 2014/07/14 18:17:38 Done.
22 public:
23 // Return pointer to the singleton instance for the current process.
24 static SystemHotkeyHelperMac* GetInstance();
25
26 // Loads the system hot keys after a brief delay, to reduce file system access
27 // immediately after launch.
28 void DeferredLoadSystemHotkeys();
29
30 // Guaranteed to not be NULL.
31 SystemHotkeyMap* map() { return map_.get(); }
32
33 private:
34 friend struct DefaultSingletonTraits<SystemHotkeyHelperMac>;
35
36 SystemHotkeyHelperMac();
37 virtual ~SystemHotkeyHelperMac();
Robert Sesek 2014/07/14 15:33:31 Doesn't need to be virtual.
erikchen 2014/07/14 18:17:38 Done.
38
39 // Must be called from the FILE thread. Loads the file containing the system
40 // hotkeys into a NSDictionary* object, and passes the result to FileDidLoad
41 // on the UI thread.
42 void LoadSystemHotkeys();
43
44 // Must be called from the UI thread. |dictionary| should have a retain count
45 // of +1. This method will release |dictionary|. Parses the system hotkeys
46 // from the plist stored in |dictionary|.
47 void FileDidLoad(NSDictionary* dictionary);
Avi (use Gerrit) 2014/07/10 02:19:10 If you can express this with a parameter of scoped
Robert Sesek 2014/07/14 15:33:31 I'd just rephrase the comment to say "This takes o
erikchen 2014/07/14 18:17:38 I rephrased the comment as per rsesek's suggestion
48
49 scoped_ptr<SystemHotkeyMap> map_;
50
51 DISALLOW_COPY_AND_ASSIGN(SystemHotkeyHelperMac);
52 };
53
54 } // namespace content
55
56 #endif // CONTENT_BROWSER_COCOA_SYSTEM_HOTKEY_HELPER_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698