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

Unified Diff: chrome/common/extensions/docs/static/experimental.keybinding.html

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
« no previous file with comments | « chrome/common/extensions/docs/experimental.keybinding.html ('k') | chrome/common/extensions/extension.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/static/experimental.keybinding.html
===================================================================
--- chrome/common/extensions/docs/static/experimental.keybinding.html (revision 129600)
+++ chrome/common/extensions/docs/static/experimental.keybinding.html (working copy)
@@ -8,7 +8,8 @@
<h2 id="manifest">Manifest</h2>
<p>
In addition to the "experimental" permission you must declare the "keybinding"
-permission in your extension's manifest to use this API.
+permission in your extension's manifest to use this API and set manifest_version
+to (at least) 2.
</p>
<pre>{
@@ -33,23 +34,34 @@
...
<b> "commands": {
"toggle-feature-foo": {
- "key": "Ctrl+Shift+Y",
+ "suggested_key": {
+ "default": "Ctrl+Shift+Y",
+ "mac": "Command+Shift+Y"
+ },
"description": "Toggle feature foo"
},
- "browserAction": {
- "key": "Ctrl+Shift+B"
+ "_execute_browser_action": {
+ "suggested_key": {
+ "windows": "Ctrl+Shift+Y",
+ "mac": "Command+Shift+Y",
+ "chromeos": "Ctrl+Shift+U",
+ "linux": "Ctrl+Shift+J"
+ }
},
- "pageAction": {
- "key": "Alt+P"
+ "_execute_page_action": {
+ "suggested_key": {
+ "default": "Ctrl+E"
+ "windows": "Alt+P",
+ "mac": "Option+P",
+ }
}
-
}</b>,
...
}</pre>
<p>In your background page, you can bind a handler to each of the commands
-defined in the manifest (except for 'browserAction' and 'pageAction') via
-onCommand.addListener. For example:</p>
+defined in the manifest (except for '_execute_browser_action' and
+'_execute_page_action') via onCommand.addListener. For example:</p>
<pre>
chrome.experimental.keybinding.onCommand.addListener(function(command) {
@@ -57,9 +69,10 @@
});
</pre>
-<p>The 'browserAction' and 'pageAction' commands are reserved for the action of
-opening your extension's popups. They won't normally generate events that you
-can handle. If you need to take action based on your popup opening, consider
-listening for an 'onDomReady' event inside your popup's code.
+<p>The '_execute_browser_action' and '_execute_page_action' commands are
+reserved for the action of opening your extension's popups. They won't normally
+generate events that you can handle. If you need to take action based on your
+popup opening, consider listening for an 'onDomReady' event inside your popup's
+code.
</p>
<!-- END AUTHORED CONTENT -->
« no previous file with comments | « chrome/common/extensions/docs/experimental.keybinding.html ('k') | chrome/common/extensions/extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698