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

Unified Diff: chrome/browser/extensions/extension_keybinding_registry.h

Issue 10911020: Enable commands API for platform apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
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..68ad6a2f2ffc9d7cddd3c562f32c68fcd8702a32 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_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);
};

Powered by Google App Engine
This is Rietveld 408576698