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

Unified Diff: chrome/common/extensions/extension.h

Issue 9812008: Polish the keybinding implementation a bit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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/common/extensions/extension.h
===================================================================
--- chrome/common/extensions/extension.h (revision 127690)
+++ chrome/common/extensions/extension.h (working copy)
@@ -151,6 +151,12 @@
class ExtensionKeybinding {
public:
+ enum Type {
+ BROWSER_ACTION,
+ PAGE_ACTION,
+ COMMANDS,
+ };
+
// Define out of line constructor/destructor to please Clang.
ExtensionKeybinding();
~ExtensionKeybinding();
@@ -523,6 +529,11 @@
// Returns true if the extension should be displayed in the launcher.
bool ShouldDisplayInLauncher() const;
+ // Gets an extension keybindings by |type|.
+ void GetCommandByType(
+ Extension::ExtensionKeybinding::Type type,
+ std::vector<Extension::ExtensionKeybinding>* keybindings) const;
+
// Accessors:
const FilePath& path() const { return path_; }
@@ -551,6 +562,8 @@
const std::vector<InputComponentInfo>& input_components() const {
return input_components_;
}
+ // See also GetCommandByType, which allows finer grained control over
+ // which commands are returned.
const std::vector<ExtensionKeybinding>& keybindings() const {
return commands_;
}

Powered by Google App Engine
This is Rietveld 408576698