Chromium Code Reviews| Index: chrome/common/extensions/extension.h |
| =================================================================== |
| --- chrome/common/extensions/extension.h (revision 122745) |
| +++ chrome/common/extensions/extension.h (working copy) |
| @@ -26,6 +26,7 @@ |
| #include "chrome/common/extensions/url_pattern.h" |
| #include "chrome/common/extensions/url_pattern_set.h" |
| #include "googleurl/src/gurl.h" |
| +#include "ui/base/accelerators/accelerator.h" |
| #include "ui/gfx/size.h" |
| class ExtensionAction; |
| @@ -153,6 +154,29 @@ |
| bool shortcut_shift; |
| }; |
| + class ExtensionKeybinding { |
| + public: |
| + // Define out of line constructor/destructor to please Clang. |
| + ExtensionKeybinding(); |
| + ~ExtensionKeybinding(); |
| + |
| + // Parse the key binding. |
| + bool Parse(base::DictionaryValue* command, |
| + const std::string& event_name, |
| + string16* error, |
| + int index); |
| + |
| + // Accessors: |
| + const std::string& event_name() const { return event_name_; } |
|
Matt Perry
2012/02/21 23:13:39
event_name sounds like the name of the event that
|
| + const ui::Accelerator& accelerator() const { return accelerator_; } |
| + const std::string& description() const { return description_; } |
| + |
| + private: |
| + std::string event_name_; |
| + ui::Accelerator accelerator_; |
| + std::string description_; |
| + }; |
| + |
| struct TtsVoice { |
| // Define out of line constructor/destructor to please Clang. |
| TtsVoice(); |
| @@ -533,6 +557,9 @@ |
| const std::vector<InputComponentInfo>& input_components() const { |
| return input_components_; |
| } |
| + const std::vector<ExtensionKeybinding>& keybindings() const { |
| + return commands_; |
| + } |
| bool has_background_page() const { |
| return background_url_.is_valid() || !background_scripts_.empty(); |
| } |
| @@ -809,6 +836,9 @@ |
| // Optional list of input components and associated properties. |
| std::vector<InputComponentInfo> input_components_; |
| + // Optional list of commands (keyboard shortcuts). |
| + std::vector<ExtensionKeybinding> commands_; |
| + |
| // Optional list of web accessible extension resources. |
| base::hash_set<std::string> web_accessible_resources_; |
| @@ -948,8 +978,8 @@ |
| // The details sent for EXTENSION_PERMISSIONS_UPDATED notifications. |
| struct UpdatedExtensionPermissionsInfo { |
| enum Reason { |
| - ADDED, // The permissions were added to the extension. |
| - REMOVED, // The permissions were removed from the extension. |
| + ADDED, // The permissions were added to the extension. |
| + REMOVED, // The permissions were removed from the extension. |
| }; |
| Reason reason; |