Chromium Code Reviews| Index: chrome/browser/extensions/extension_commands_global_registry.h |
| diff --git a/chrome/browser/extensions/extension_commands_global_registry.h b/chrome/browser/extensions/extension_commands_global_registry.h |
| index 92a7a8e42b4073ab50a7802fea22dc99b01f798e..e17e34bd1dbd2863038b52a55235e5c61ea4e9ad 100644 |
| --- a/chrome/browser/extensions/extension_commands_global_registry.h |
| +++ b/chrome/browser/extensions/extension_commands_global_registry.h |
| @@ -47,6 +47,20 @@ class ExtensionCommandsGlobalRegistry |
| explicit ExtensionCommandsGlobalRegistry(content::BrowserContext* context); |
| virtual ~ExtensionCommandsGlobalRegistry(); |
| + // Returns which non-global command registry is active (belonging to the |
| + // currently active window). |
| + ExtensionKeybindingRegistry* registry_for_active_window() { |
| + return registry_for_active_window_; |
| + } |
| + |
| + void set_registry_for_active_window(ExtensionKeybindingRegistry* registry) { |
| + registry_for_active_window_ = registry; |
| + } |
| + |
| + // Returns whether |accelerator| is registered on the registry for the active |
| + // window or on the global registry. |
| + bool IsRegisteredForActiveWindow(const ui::Accelerator& accelerator); |
|
Finnur
2014/09/16 10:29:14
This should just be IsRegistered(). We're not just
David Tseng
2014/09/16 15:29:39
Done. Comment should suffice to disambiguate IsReg
|
| + |
| private: |
| friend class BrowserContextKeyedAPIFactory<ExtensionCommandsGlobalRegistry>; |
| @@ -70,6 +84,13 @@ class ExtensionCommandsGlobalRegistry |
| // Weak pointer to our browser context. Not owned by us. |
| content::BrowserContext* browser_context_; |
| + // The global commands registry not only keeps track of global commands |
| + // registered, but also of which non-global command registry is active |
| + // (belonging to the currently active window). Only valid for TOOLKIT_VIEWS |
| + // and |
| + // NULL otherwise. |
| + ExtensionKeybindingRegistry* registry_for_active_window_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(ExtensionCommandsGlobalRegistry); |
| }; |