Chromium Code Reviews| Index: chrome/browser/extensions/extension_keybinding_registry.h |
| diff --git a/chrome/browser/extensions/extension_keybinding_registry.h b/chrome/browser/extensions/extension_keybinding_registry.h |
| index 76ecd9133aaa3f682cbb4e48fd3abbd111692af3..1b102a3d3e8b1f0a477247077113bfafc97e1028 100644 |
| --- a/chrome/browser/extensions/extension_keybinding_registry.h |
| +++ b/chrome/browser/extensions/extension_keybinding_registry.h |
| @@ -24,7 +24,15 @@ class Extension; |
| // implementation details for each platform. |
| class ExtensionKeybindingRegistry : public content::NotificationObserver { |
| public: |
| - explicit ExtensionKeybindingRegistry(Profile* profile); |
| + enum ExtensionFilter { |
| + ALL_EXTENSIONS, |
| + PLATFORM_APP_ONLY |
|
Mihai Parparita -not on Chrome
2012/09/04 22:09:46
Nit: call this PLATFORM_APPS_ONLY.
|
| + }; |
| + |
| + // If |extension_filter| is not ALL_EXTENSIONS, only keybindings by |
| + // by extensions that match the filter will be registered. |
| + ExtensionKeybindingRegistry(Profile* profile, |
| + ExtensionFilter extension_filter); |
| virtual ~ExtensionKeybindingRegistry(); |
| // Enables/Disables general shortcut handing in Chrome. Implemented in |
| @@ -57,12 +65,18 @@ class ExtensionKeybindingRegistry : public content::NotificationObserver { |
| bool ShouldIgnoreCommand(const std::string& command) const; |
| private: |
| + // Returns true if the |extension| matches our extension filter. |
| + bool ExtensionMatchesFilter(const extensions::Extension* extension); |
| + |
| // The content notification registrar for listening to extension events. |
| content::NotificationRegistrar registrar_; |
| - // Weak pointer to the our profile. Not owned by us. |
| + // Weak pointer to our profile. Not owned by us. |
| Profile* profile_; |
| + // What extensions to register keybindings for. |
| + ExtensionFilter extension_filter_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(ExtensionKeybindingRegistry); |
| }; |