From 85ae959285a1ed1d423abd3d01cac5a71cd7b51f Mon Sep 17 00:00:00 2001 From: "skerner@chromium.org" Date: Wed, 3 Feb 2010 20:58:50 +0000 Subject: Implement chrome.browserAction.setPopup(). BUG=27526 TEST=Unit tests BrowserActionApiTest.BrowserAction*Popup . Review URL: http://codereview.chromium.org/552263 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38015 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/extensions/docs/browserAction.html | 192 ++++++++++++++++++++++- 1 file changed, 185 insertions(+), 7 deletions(-) (limited to 'chrome/common/extensions/docs/browserAction.html') diff --git a/chrome/common/extensions/docs/browserAction.html b/chrome/common/extensions/docs/browserAction.html index 800a81e..c46c136 100644 --- a/chrome/common/extensions/docs/browserAction.html +++ b/chrome/common/extensions/docs/browserAction.html @@ -251,6 +251,8 @@
  • setIcon
  • + setPopup +
  • setTitle
  • @@ -288,7 +290,7 @@ a browser action can also have a tooltip, a badge, - and a popup. + and a popup.

    @@ -323,7 +325,7 @@ like this: "browser_action": { "default_icon": "images/icon19.png", // required "default_title": "Google Mail", // optional; shown in tooltip - "popup": "popup.html" // optional + "default_popup": "popup.html" // optional }, ... } @@ -335,7 +337,7 @@ A browser action must have an icon. It can also have a tooltip, a badge, -and a popup. +and a popup.

    Icon

    @@ -406,9 +408,9 @@ respectively.

    To add a popup to your browser action, create an HTML file with the popup's contents. -Then specify the HTML file in -the manifest, -using the popup field of browser_action. +Specify the HTML file in the default_popup field of browser_action +in the manifest, or call the +setPopup() method.

    Tips

    @@ -1061,6 +1063,182 @@ For other examples and for help in viewing the source code, see
    + +

    setPopup

    + +
    void + + chrome.browserAction.setPopup(, object + details)
    + +
    + +

    Sets the html document to be opened as a popup when the user clicks on the browser action's icon.

    + + +

    Parameters

    +
    +
    +
    +
    + details + + + +
    + ( + + + + Type + + + + array of + + object + + + ) +
    + +
    +
    +
    + Undocumented. +
    +
    + Description of this parameter from the json schema. +
    + + +
    +
    +
    +
    +
    + tabId + + + +
    + ( + optional + + + Type + + + + array of + + integer + + + ) +
    + +
    +
    + +
    Limits the change to when a particular tab is selected. Automatically resets when the tab is closed.
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + popup + + + +
    + ( + + + + Type + + + + array of + + string + + + ) +
    + +
    +
    + +
    The html file to show in a popup. If set to the empty string (''), no popup is shown.
    + + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +

    Returns

    +
    +
    +
    +
    +
    +
    + + +
    +
    +

    Callback function

    +

    + The callback parameter should specify a function + that looks like this: +

    +

    + If you specify the callback parameter, it should + specify a function that looks like this: +

    + + +
    function(Type param1, Type param2) {...});
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    + +

    setTitle

    @@ -1257,7 +1435,7 @@ For other examples and for help in viewing the source code, see
    -

    Fired when a browser action icon is clicked.

    +

    Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup.

    Parameters

    -- cgit v1.1