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

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)
@@ -167,10 +167,15 @@
const std::string& description() const { return description_; }
private:
+ ui::Accelerator ParseImpl(const std::string& shortcut,
+ const std::string& platform_key,
+ int index,
+ string16* error);
std::string command_name_;
ui::Accelerator accelerator_;
std::string description_;
};
+ typedef std::map<std::string, ExtensionKeybinding> Commands;
Aaron Boodman 2012/03/26 21:44:57 Naming nit: CommandMap? Just commands seems too am
struct TtsVoice {
// Define out of line constructor/destructor to please Clang.
@@ -551,9 +556,15 @@
const std::vector<InputComponentInfo>& input_components() const {
return input_components_;
}
- const std::vector<ExtensionKeybinding>& keybindings() const {
- return commands_;
+ const ExtensionKeybinding* browser_action_command() const {
Aaron Boodman 2012/03/26 21:44:57 I think it would be more traditional to make these
Finnur 2012/03/29 14:57:27 Traditional perhaps, but one of those (ba/pa) is g
Aaron Boodman 2012/03/29 20:57:28 Oh, duh, you are totally right. Sorry.
+ return browser_action_command_.get();
}
+ const ExtensionKeybinding* page_action_command() const {
+ return page_action_command_.get();
+ }
+ const Commands& named_commands() const {
+ return named_commands_;
+ }
bool has_background_page() const {
return background_url_.is_valid() || !background_scripts_.empty();
}
@@ -895,7 +906,9 @@
std::vector<InputComponentInfo> input_components_;
// Optional list of commands (keyboard shortcuts).
- std::vector<ExtensionKeybinding> commands_;
+ scoped_ptr<ExtensionKeybinding> browser_action_command_;
+ scoped_ptr<ExtensionKeybinding> page_action_command_;
+ Commands named_commands_;
// Optional list of web accessible extension resources.
base::hash_set<std::string> web_accessible_resources_;
« no previous file with comments | « chrome/common/extensions/docs/static/experimental.keybinding.html ('k') | chrome/common/extensions/extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698