From e558ff82d3f37169fad4abd52200dc75651a3ab5 Mon Sep 17 00:00:00 2001 From: "asargent@chromium.org" Date: Thu, 23 Sep 2010 20:19:56 +0000 Subject: Add a launchApp method to extension management API. This makes it possible for new tab replacement extensions to recreate the same app launch experience as the built-in NTP (pinned tabs, launch containers, etc.) Also add the extension version to data we report about extensions via the management API. BUG=56325,55474 TEST=An extension using chrome.experimental.management.launchApp() should work to launch an app the same way that app gets launched from the built-in new tab page. Review URL: http://codereview.chromium.org/3381019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60334 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/extensions/api/extension_api.json | 21 ++ .../extensions/docs/experimental.management.html | 240 +++++++++++++++++++++ 2 files changed, 261 insertions(+) (limited to 'chrome/common') diff --git a/chrome/common/extensions/api/extension_api.json b/chrome/common/extensions/api/extension_api.json index 0583904..edbfdc1 100644 --- a/chrome/common/extensions/api/extension_api.json +++ b/chrome/common/extensions/api/extension_api.json @@ -3939,6 +3939,10 @@ "description": "The name of this extension or app.", "type": "string" }, + "version": { + "description": "The version of this extension or app.", + "type": "string" + }, "enabled": { "description": "Whether it is currently enabled or disabled.", "type": "boolean" @@ -4031,6 +4035,23 @@ "parameters": [] } ] + }, + { + "name": "launchApp", + "description": "Launches an application.", + "parameters": [ + { + "name": "id", + "type": "string", + "description": "The extension id of the application." + }, + { + "name": "callback", + "type": "function", + "optional": "true", + "parameters": [] + } + ] } ], "events": [ diff --git a/chrome/common/extensions/docs/experimental.management.html b/chrome/common/extensions/docs/experimental.management.html index 663f432..2e13052 100644 --- a/chrome/common/extensions/docs/experimental.management.html +++ b/chrome/common/extensions/docs/experimental.management.html @@ -258,6 +258,8 @@
  • getAll
  • + launchApp +
  • setEnabled
  • uninstall @@ -523,6 +525,186 @@
    + +

    launchApp

    + +
    void + + chrome.experimental.management.launchApp(, string + id, function + callback)
    + +
    + +

    Launches an application.

    + + +

    Parameters

    +
    +
    +
    +
    + id + + + +
    + ( + + + + + Type + + + + array of + + string + + + + ) +
    + +
    +
    + +
    The extension id of the application.
    +
    + This parameter was added in version + . + You must omit this parameter in earlier versions, + and you may omit it in any version. If you require this + parameter, the manifest key + minimum_chrome_version + can ensure that your extension won't be run in an earlier browser version. +
    + + +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + +
    +
    +
    +
    + callback + + + +
    + ( + optional + + + + Type + + + + array of + + function + + + + ) +
    + +
    +
    +
    + Undocumented. +
    +
    + Description of this parameter from the json schema. +
    +
    + This parameter was added in version + . + You must omit this parameter in earlier versions, + and you may omit it in any version. If you require this + parameter, the manifest key + minimum_chrome_version + can ensure that your extension won't be run in an earlier browser version. +
    + + +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + +
    +
    +
    + + +

    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() {...};
    +
    +
    +
    +
    +
    +
    +
    +
    + + +

    + This function was added in version . + If you require this function, the manifest key + minimum_chrome_version + can ensure that your extension won't be run in an earlier browser version. +

    +
    + +

    setEnabled

    @@ -1627,6 +1809,64 @@
    + version + + + +
    + ( + + + + + Type + + + + array of + + string + + + + ) +
    + +
    +
    + +
    The version of this extension or app.
    +
    + This parameter was added in version + . + You must omit this parameter in earlier versions, + and you may omit it in any version. If you require this + parameter, the manifest key + minimum_chrome_version + can ensure that your extension won't be run in an earlier browser version. +
    + + +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    + +
    +
    +
    +
    enabled -- cgit v1.1