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

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

Issue 9402018: Experimental Extension Keybinding (first cut). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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
« no previous file with comments | « chrome/common/extensions/api/extension_api.cc ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.h
===================================================================
--- chrome/common/extensions/extension.h (revision 123221)
+++ 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& command_name,
+ int index,
+ string16* error);
+
+ // Accessors:
+ const std::string& command_name() const { return command_name_; }
+ const ui::Accelerator& accelerator() const { return accelerator_; }
+ const std::string& description() const { return description_; }
+
+ private:
+ std::string command_name_;
+ ui::Accelerator accelerator_;
+ std::string description_;
+ };
+
struct TtsVoice {
// Define out of line constructor/destructor to please Clang.
TtsVoice();
@@ -528,6 +552,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();
}
@@ -804,6 +831,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_;
@@ -943,8 +973,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;
« no previous file with comments | « chrome/common/extensions/api/extension_api.cc ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698