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

Side by Side Diff: chrome/browser/ui/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: Histograms and dchecks. 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 CHROME_BROWSER_UI_COCOA_SYSTEM_HOTKEY_HELPER_MAC_H_
6 #define CHROME_BROWSER_UI_COCOA_SYSTEM_HOTKEY_HELPER_MAC_H_
7
8 #include "base/memory/singleton.h"
9 #include "base/memory/weak_ptr.h"
10
11 class SystemHotkeyMap;
12
13 class SystemHotkeyHelperMac {
14 public:
15 // Return pointer to the singleton instance for the current process.
16 static SystemHotkeyHelperMac* GetInstance();
17
18 // Loads the system hot keys after a brief delay, to reduce file system access
19 // immediately after launch.
20 void DeferredLoadSystemHotkeys();
21
22 // Guaranteed to not be NULL.
23 SystemHotkeyMap* map() { return map_.get(); }
24
25 private:
26 friend struct DefaultSingletonTraits<SystemHotkeyHelperMac>;
27
28 SystemHotkeyHelperMac();
29 virtual ~SystemHotkeyHelperMac();
30
31 // Retrieves the relevant plist file from disk on a background thread, and
32 // parses it on the main thread.
33 void LoadSystemHotkeys();
34
35 scoped_ptr<SystemHotkeyMap> map_;
36 base::WeakPtrFactory<SystemHotkeyHelperMac> weak_ptr_factory_;
37
38 DISALLOW_COPY_AND_ASSIGN(SystemHotkeyHelperMac);
39 };
40
41 #endif // CHROME_BROWSER_UI_COCOA_SYSTEM_HOTKEY_HELPER_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698