OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // Returns true if we can find it, |extension_id| and |command_name| will be | 114 // Returns true if we can find it, |extension_id| and |command_name| will be |
115 // set to the right target; otherwise, false is returned and |extension_id|, | 115 // set to the right target; otherwise, false is returned and |extension_id|, |
116 // |command_name| are unchanged. | 116 // |command_name| are unchanged. |
117 bool GetFirstTarget(const ui::Accelerator& accelerator, | 117 bool GetFirstTarget(const ui::Accelerator& accelerator, |
118 std::string* extension_id, | 118 std::string* extension_id, |
119 std::string* command_name) const; | 119 std::string* command_name) const; |
120 | 120 |
121 // Returns true if the |event_targets_| is empty; otherwise returns false. | 121 // Returns true if the |event_targets_| is empty; otherwise returns false. |
122 bool IsEventTargetsEmpty() const; | 122 bool IsEventTargetsEmpty() const; |
123 | 123 |
| 124 // Returns the BrowserContext for this registry. |
| 125 content::BrowserContext* browser_context() const { return browser_context_; } |
| 126 |
124 private: | 127 private: |
125 // Overridden from content::NotificationObserver: | 128 // Overridden from content::NotificationObserver: |
126 virtual void Observe(int type, | 129 virtual void Observe(int type, |
127 const content::NotificationSource& source, | 130 const content::NotificationSource& source, |
128 const content::NotificationDetails& details) OVERRIDE; | 131 const content::NotificationDetails& details) OVERRIDE; |
129 | 132 |
130 // ExtensionRegistryObserver implementation. | 133 // ExtensionRegistryObserver implementation. |
131 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, | 134 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, |
132 const Extension* extension) OVERRIDE; | 135 const Extension* extension) OVERRIDE; |
133 virtual void OnExtensionUnloaded( | 136 virtual void OnExtensionUnloaded( |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 // Listen to extension load, unloaded notifications. | 173 // Listen to extension load, unloaded notifications. |
171 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 174 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
172 extension_registry_observer_; | 175 extension_registry_observer_; |
173 | 176 |
174 DISALLOW_COPY_AND_ASSIGN(ExtensionKeybindingRegistry); | 177 DISALLOW_COPY_AND_ASSIGN(ExtensionKeybindingRegistry); |
175 }; | 178 }; |
176 | 179 |
177 } // namespace extensions | 180 } // namespace extensions |
178 | 181 |
179 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_ | 182 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_KEYBINDING_REGISTRY_H_ |
OLD | NEW |