diff options
author | asargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-17 22:41:43 +0000 |
---|---|---|
committer | asargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-17 22:41:43 +0000 |
commit | e0bccbae8ef62584a91407e2eebc3cecdddced2a (patch) | |
tree | 21903648a41d703f49c4d9a151bff4af7c0becab | |
parent | 3b49114078a0305d5eb99a732d709119840aa4cd (diff) | |
download | chromium_src-e0bccbae8ef62584a91407e2eebc3cecdddced2a.zip chromium_src-e0bccbae8ef62584a91407e2eebc3cecdddced2a.tar.gz chromium_src-e0bccbae8ef62584a91407e2eebc3cecdddced2a.tar.bz2 |
Two extensions doc cleanups.
-Note presence of tab property on message ports in background pages and toolstrips
-Fix pageActions listener callback reference
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/208003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26517 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-x | chrome/common/extensions/api/extension_api.json | 3 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/extension.html | 43 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/pageActions.html | 19 | ||||
-rwxr-xr-x | chrome/common/extensions/docs/static/pageActions.html | 19 |
4 files changed, 64 insertions, 20 deletions
diff --git a/chrome/common/extensions/api/extension_api.json b/chrome/common/extensions/api/extension_api.json index 76fee6a..558b22f 100755 --- a/chrome/common/extensions/api/extension_api.json +++ b/chrome/common/extensions/api/extension_api.json @@ -10,7 +10,8 @@ "name": {"type": "string"}, "onDisconnect": {"type": "object"}, "onMessage": {"type": "object"}, - "postMessage": {"type": "function"} + "postMessage": {"type": "function"}, + "tab": {"$ref": "Tab", "optional": true, "description":"This property will <b>only</b> be present on ports passed to onConnect listeners when the connection was opened from a tab or content script."} } } ], diff --git a/chrome/common/extensions/docs/extension.html b/chrome/common/extensions/docs/extension.html index a8025d1..41dfc60 100755 --- a/chrome/common/extensions/docs/extension.html +++ b/chrome/common/extensions/docs/extension.html @@ -1369,7 +1369,7 @@ For details, see </dl> </dd> </div> - </div><div jsinstance="*3"> + </div><div jsinstance="3"> <div> <dt> <var>postMessage</var> @@ -1412,6 +1412,47 @@ For details, see </dl> </dd> </div> + </div><div jsinstance="*4"> + <div> + <dt> + <var>tab</var> + <em> + + <!-- TYPE --> + <div style="display:inline"> + ( + <span class="optional">optional</span> + <span id="typeTemplate"> + <span> + <a href="tabs.html#type-Tab">Tab</a> + </span> + <span style="display: none; "> + <span> + array of <span><span></span></span> + </span> + <span>paramType</span> + </span> + </span> + ) + </div> + + </em> + </dt> + <dd class="todo" style="display: none; "> + Undocumented. + </dd> + <dd>This property will <b>only</b> be present on ports passed to onConnect listeners when the connection was opened from a tab or content script.</dd> + + <!-- OBJECT PROPERTIES --> + <dd style="display: none; "> + <dl> + <div> + <div> + </div> + </div> + </dl> + </dd> + </div> </div> </dl> </dd> diff --git a/chrome/common/extensions/docs/pageActions.html b/chrome/common/extensions/docs/pageActions.html index aff591c..c189d45 100755 --- a/chrome/common/extensions/docs/pageActions.html +++ b/chrome/common/extensions/docs/pageActions.html @@ -237,24 +237,25 @@ the RSS feed for the current page. <p>Page action events are created dynamically using the id of the page action declared in the manifest. For example, a page action with id 'foo' will setup an event called chrome.pageActions["foo"]. An extension would then register listeners like so:</p> -<pre>chrome.pageActions["foo"].addListener(function(object reply) { - console.log(reply.pageActionId); // Display the id of the page action. - console.log(reply.data.tabId); // Display the id of the tab for which the page action event applies. - console.log(reply.data.tabUrl); // Display the URL of the page for which the page action event applies. +<pre>chrome.pageActions["foo"].addListener(function(pageActionId, info) { + console.log(pageActionId); // Display the id of the page action. + console.log(info.tabId); // Display the id of the tab for which the page action event applies. + console.log(info.tabUrl); // Display the URL of the page for which the page action event applies. + console.log(info.button); // Display the number of the button which the user clicked with. });</pre> <p style="margin-left:25px;"><strong>Parameters</strong></p> -<p style="margin-left:25px;"><i>reply ( object )</i><br> - An object containing the information about the event. Contains the following properties:</p> -<p style="margin-left:50px;"><i>pageActionId ( string )</i><br> +<p style="margin-left:25px;"><i>pageActionId ( string )</i><br> The id of the page action that triggered the event.</p> -<p style="margin-left:50px;"><i>data ( object )</i><br> - An object specifying what tab and which page the event applies to. Contains the following properties:</p> +<p style="margin-left:25px;"><i>info ( object )</i><br> + An object containing information about the event and what tab and page the event applies to. Contains the following properties:</p> <p style="margin-left:75px;"><i>tabId ( string )</i><br> The id of the tab that was active when the event was triggered.</p> <p style="margin-left:75px;"><i>tabUrl ( string )</i><br> The url of the page for which the page action applies to.</p> +<p style="margin-left:75px;"><i>button ( integer )</i><br> + The mouse button which was pressed. The left button is 1, middle button is 2, and right button is 3.</p> <!-- END AUTHORED CONTENT --> </div> diff --git a/chrome/common/extensions/docs/static/pageActions.html b/chrome/common/extensions/docs/static/pageActions.html index b63a49c..1902738 100755 --- a/chrome/common/extensions/docs/static/pageActions.html +++ b/chrome/common/extensions/docs/static/pageActions.html @@ -34,22 +34,23 @@ the RSS feed for the current page. <p>Page action events are created dynamically using the id of the page action declared in the manifest. For example, a page action with id 'foo' will setup an event called chrome.pageActions["foo"]. An extension would then register listeners like so:</p> -<pre>chrome.pageActions["foo"].addListener(function(object reply) { - console.log(reply.pageActionId); // Display the id of the page action. - console.log(reply.data.tabId); // Display the id of the tab for which the page action event applies. - console.log(reply.data.tabUrl); // Display the URL of the page for which the page action event applies. +<pre>chrome.pageActions["foo"].addListener(function(pageActionId, info) { + console.log(pageActionId); // Display the id of the page action. + console.log(info.tabId); // Display the id of the tab for which the page action event applies. + console.log(info.tabUrl); // Display the URL of the page for which the page action event applies. + console.log(info.button); // Display the number of the button which the user clicked with. });</pre> <p style="margin-left:25px;"><strong>Parameters</strong></p> -<p style="margin-left:25px;"><i>reply ( object )</i><br> - An object containing the information about the event. Contains the following properties:</p> -<p style="margin-left:50px;"><i>pageActionId ( string )</i><br> +<p style="margin-left:25px;"><i>pageActionId ( string )</i><br> The id of the page action that triggered the event.</p> -<p style="margin-left:50px;"><i>data ( object )</i><br> - An object specifying what tab and which page the event applies to. Contains the following properties:</p> +<p style="margin-left:25px;"><i>info ( object )</i><br> + An object containing information about the event and what tab and page the event applies to. Contains the following properties:</p> <p style="margin-left:75px;"><i>tabId ( string )</i><br> The id of the tab that was active when the event was triggered.</p> <p style="margin-left:75px;"><i>tabUrl ( string )</i><br> The url of the page for which the page action applies to.</p> +<p style="margin-left:75px;"><i>button ( integer )</i><br> + The mouse button which was pressed. The left button is 1, middle button is 2, and right button is 3.</p> <!-- END AUTHORED CONTENT --> |