Commit 0533f99a authored by Tim Judkins's avatar Tim Judkins Committed by Commit Bot

[Extensions] Enable promise support on the management API

This CL changes over the json schema to use the new returns_async format
to define callbacks, enabling promise support on those APIs.

Bug: 328932
Change-Id: I13caaf4f9eff77db7cb0afc1516ed485e1908556
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2515142Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: Tim Judkins <tjudkins@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826848}
parent 3475c040
......@@ -178,22 +178,20 @@
{
"name": "getAll",
"description": "Returns a list of information about installed extensions and apps.",
"parameters": [
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"type": "array",
"name": "result",
"items": {
"$ref": "ExtensionInfo"
}
"parameters": [],
"returns_async": {
"name": "callback",
"optional": true,
"parameters": [
{
"type": "array",
"name": "result",
"items": {
"$ref": "ExtensionInfo"
}
]
}
]
}
]
}
},
{
"name": "get",
......@@ -203,36 +201,33 @@
"name": "id",
"type": "string",
"description": "The ID from an item of $(ref:management.ExtensionInfo)."
},
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"name": "result",
"$ref": "ExtensionInfo"
}
]
}
]
],
"returns_async": {
"name": "callback",
"optional": true,
"parameters": [
{
"name": "result",
"$ref": "ExtensionInfo"
}
]
}
},
{
"name": "getSelf",
"description": "Returns information about the calling extension, app, or theme. Note: This function can be used without requesting the 'management' permission in the manifest.",
"parameters": [
{
"type": "function",
"name": "callback",
"optional": true,
"parameters": [
{
"name": "result",
"$ref": "ExtensionInfo"
}
]
}
]
"parameters": [],
"returns_async": {
"name": "callback",
"optional": true,
"parameters": [
{
"name": "result",
"$ref": "ExtensionInfo"
}
]
}
},
{
"name": "getPermissionWarningsById",
......@@ -241,20 +236,19 @@
{ "name": "id",
"type": "string",
"description": "The ID of an already installed extension."
},
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": [
{
"name": "permissionWarnings",
"type": "array",
"items": { "type": "string" }
}
]
}
]
],
"returns_async": {
"name": "callback",
"optional": true,
"parameters": [
{
"name": "permissionWarnings",
"type": "array",
"items": { "type": "string" }
}
]
}
},
{
"name": "getPermissionWarningsByManifest",
......@@ -264,20 +258,19 @@
"name": "manifestStr",
"type": "string",
"description": "Extension manifest JSON string."
},
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": [
{
"name": "permissionWarnings",
"type": "array",
"items": { "type": "string" }
}
]
}
]
],
"returns_async": {
"name": "callback",
"optional": true,
"parameters": [
{
"name": "permissionWarnings",
"type": "array",
"items": { "type": "string" }
}
]
}
},
{
"name": "setEnabled",
......@@ -292,14 +285,13 @@
"name": "enabled",
"type": "boolean",
"description": "Whether this item should be enabled or disabled."
},
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": []
}
]
],
"returns_async": {
"name": "callback",
"optional": true,
"parameters": []
}
},
{
"name": "uninstall",
......@@ -314,14 +306,13 @@
"name": "options",
"$ref": "UninstallOptions",
"optional": true
},
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": []
}
]
],
"returns_async": {
"name": "callback",
"optional": true,
"parameters": []
}
},
{
"name": "uninstallSelf",
......@@ -331,14 +322,13 @@
"name": "options",
"$ref": "UninstallOptions",
"optional": true
},
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": []
}
]
],
"returns_async": {
"name": "callback",
"optional": true,
"parameters": []
}
},
{
"name": "launchApp",
......@@ -348,14 +338,13 @@
"name": "id",
"type": "string",
"description": "The extension id of the application."
},
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": []
}
]
],
"returns_async": {
"name": "callback",
"optional": true,
"parameters": []
}
},
{
"name": "createAppShortcut",
......@@ -365,14 +354,13 @@
"name": "id",
"type": "string",
"description": "This should be the id from an app item of $(ref:management.ExtensionInfo)."
},
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": []
}
]
],
"returns_async": {
"name": "callback",
"optional": true,
"parameters": []
}
},
{
"name": "setLaunchType",
......@@ -387,14 +375,14 @@
"name": "launchType",
"$ref": "LaunchType",
"description": "The target launch type. Always check and make sure this launch type is in $(ref:ExtensionInfo.availableLaunchTypes), because the available launch types vary on different platforms and configurations."
},
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": []
}
]
],
"returns_async": {
"name": "callback",
"type": "function",
"optional": true,
"parameters": []
}
},
{
"name": "generateAppForLink",
......@@ -409,59 +397,52 @@
"name": "title",
"type": "string",
"description": "The title of the generated app."
},
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": [
{
"name": "result",
"$ref": "ExtensionInfo"
}
]
}
]
],
"returns_async": {
"name": "callback",
"optional": true,
"parameters": [
{
"name": "result",
"$ref": "ExtensionInfo"
}
]
}
},
{
"name": "canInstallReplacementAndroidApp",
"description": "Checks if the replacement android app can be installed. Errors generated by this API are reported by setting $(ref:runtime.lastError) and executing the function's regular callback.",
"parameters": [
{
"name": "callback",
"type": "function",
"parameters": [
{
"name": "result",
"type": "boolean"
}
]
}
]
"parameters": [],
"returns_async": {
"name": "callback",
"parameters": [
{
"name": "result",
"type": "boolean"
}
]
}
},
{
"name": "installReplacementAndroidApp",
"description": "Prompts the user to install the replacement Android app from the manifest. Errors generated by this API are reported by setting $(ref:runtime.lastError) and executing the function's regular callback.",
"parameters": [
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": []
}
]
"parameters": [],
"returns_async": {
"name": "callback",
"optional": true,
"parameters": []
}
},
{
"name": "installReplacementWebApp",
"description": "Launches the replacement_web_app specified in the manifest. Prompts the user to install if not already installed.",
"parameters": [
{
"name": "callback",
"type": "function",
"optional": true,
"parameters": []
}
]
"parameters": [],
"returns_async": {
"name": "callback",
"optional": true,
"parameters": []
}
}
],
"events": [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment