OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
Devlin
2014/09/11 18:41:01
no (c), and not 2013 anymore :)
David Tseng
2014/09/11 19:34:20
Done.
| |
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_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_TRACKER_H_ | |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_TRACKER_H_ | |
7 | |
8 #include "chrome/browser/extensions/extension_keybinding_registry.h" | |
9 #include "extensions/browser/browser_context_keyed_api_factory.h" | |
10 | |
11 namespace content { | |
12 class BrowserContext; | |
13 } | |
14 | |
15 namespace extensions { | |
16 | |
17 // ExtensionKeybindingRegistryTracker holds the active BrowserWindow's | |
18 // ExtensionKeybindingRegistry. | |
19 class ExtensionKeybindingRegistryTracker : public BrowserContextKeyedAPI { | |
Devlin
2014/09/11 18:41:01
After seeing the whole of this patch, I think this
David Tseng
2014/09/11 18:58:50
I'd prefer to keep these separated since I think w
Devlin
2014/09/11 19:48:48
I don't think that making an accessor to an active
David Tseng
2014/09/11 20:38:41
Example of the confusion here...you meant Extensio
Devlin
2014/09/11 20:52:45
I think I named them all correctly in my comments
Finnur
2014/09/12 11:25:43
Thanks Devlin, for weighing in. It was good to get
| |
20 public: | |
21 // BrowserContextKeyedAPI implementation. | |
22 static BrowserContextKeyedAPIFactory<ExtensionKeybindingRegistryTracker>* | |
23 GetFactoryInstance(); | |
24 | |
25 // Convenience method to get the ExtensionKeybindingRegistryTracker for a | |
26 // profile. | |
Devlin
2014/09/11 18:41:01
nit: s/profile/browser context.
David Tseng
2014/09/11 19:34:20
Done.
| |
27 static ExtensionKeybindingRegistryTracker* Get( | |
28 content::BrowserContext* context); | |
29 | |
30 // Updates the active ExtensionKeybindingRegistry. | |
31 void Update(ExtensionKeybindingRegistry* registry); | |
32 | |
33 // Gets the active ExtensionKeybindingRegistry. | |
34 ExtensionKeybindingRegistry* GetActiveRegistry(); | |
35 | |
36 explicit ExtensionKeybindingRegistryTracker(content::BrowserContext* context); | |
Devlin
2014/09/11 18:41:01
nit: Prefer these at the top (right below public:)
David Tseng
2014/09/11 19:34:20
Done.
| |
37 virtual ~ExtensionKeybindingRegistryTracker(); | |
38 | |
39 private: | |
40 friend class BrowserContextKeyedAPIFactory< | |
41 ExtensionKeybindingRegistryTracker>; | |
42 | |
43 // BrowserContextKeyedAPI implementation. | |
44 static const char* service_name() { | |
45 return "ExtensionKeybindingRegistryTracker"; | |
46 } | |
47 | |
48 // Weak pointer to our browser context. Not owned by us. | |
49 content::BrowserContext* browser_context_; | |
50 | |
51 // The active ExtensionKeybindingRegistry. | |
52 ExtensionKeybindingRegistry* registry_; | |
53 | |
54 DISALLOW_COPY_AND_ASSIGN(ExtensionKeybindingRegistryTracker); | |
55 }; | |
56 | |
57 } // namespace extensions | |
58 | |
59 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_TRACKER_H_ | |
OLD | NEW |