Commit f53ff08e authored by Tim Judkins's avatar Tim Judkins Committed by Commit Bot

[Extensions] Enable promise support on the browserAction API

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

Note: browserAction.setIcon and browserAction.openPopus do not yet
support promises. setIcon uses a custom hook and openPopup uses a custom
callback, which will have promise support added at a later time.

Bug: 328932
Change-Id: Ie51b28bfe18f3bf5e427a59a1e5e2d04ee5116f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2515139Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: Tim Judkins <tjudkins@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826563}
parent 87e4b574
...@@ -56,9 +56,9 @@ ...@@ -56,9 +56,9 @@
"description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed." "description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."
} }
} }
}, }
{"type": "function", "name": "callback", "parameters": [], "optional": true} ],
] "returns_async": {"name": "callback", "parameters": [], "optional": true}
}, },
{ {
"name": "getTitle", "name": "getTitle",
...@@ -68,9 +68,9 @@ ...@@ -68,9 +68,9 @@
{ {
"name": "details", "name": "details",
"$ref": "TabDetails" "$ref": "TabDetails"
}, }
{ ],
"type": "function", "returns_async": {
"name": "callback", "name": "callback",
"parameters": [ "parameters": [
{ {
...@@ -79,7 +79,6 @@ ...@@ -79,7 +79,6 @@
} }
] ]
} }
]
}, },
{ {
"name": "setIcon", "name": "setIcon",
...@@ -147,9 +146,9 @@ ...@@ -147,9 +146,9 @@
"description": "The HTML file to show in a popup. If set to the empty string (''), no popup is shown." "description": "The HTML file to show in a popup. If set to the empty string (''), no popup is shown."
} }
} }
}, }
{"type": "function", "name": "callback", "parameters": [], "optional": true} ],
] "returns_async": {"name": "callback", "parameters": [], "optional": true}
}, },
{ {
"name": "getPopup", "name": "getPopup",
...@@ -159,9 +158,9 @@ ...@@ -159,9 +158,9 @@
{ {
"name": "details", "name": "details",
"$ref": "TabDetails" "$ref": "TabDetails"
}, }
{ ],
"type": "function", "returns_async": {
"name": "callback", "name": "callback",
"parameters": [ "parameters": [
{ {
...@@ -170,7 +169,6 @@ ...@@ -170,7 +169,6 @@
} }
] ]
} }
]
}, },
{ {
"name": "setBadgeText", "name": "setBadgeText",
...@@ -192,9 +190,9 @@ ...@@ -192,9 +190,9 @@
"description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed." "description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."
} }
} }
}, }
{"type": "function", "name": "callback", "parameters": [], "optional": true} ],
] "returns_async": {"name": "callback", "parameters": [], "optional": true}
}, },
{ {
"name": "getBadgeText", "name": "getBadgeText",
...@@ -204,9 +202,9 @@ ...@@ -204,9 +202,9 @@
{ {
"name": "details", "name": "details",
"$ref": "TabDetails" "$ref": "TabDetails"
}, }
{ ],
"type": "function", "returns_async": {
"name": "callback", "name": "callback",
"parameters": [ "parameters": [
{ {
...@@ -215,7 +213,6 @@ ...@@ -215,7 +213,6 @@
} }
] ]
} }
]
}, },
{ {
"name": "setBadgeBackgroundColor", "name": "setBadgeBackgroundColor",
...@@ -239,9 +236,9 @@ ...@@ -239,9 +236,9 @@
"description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed." "description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."
} }
} }
}, }
{"type": "function", "name": "callback", "parameters": [], "optional": true} ],
] "returns_async": {"name": "callback", "parameters": [], "optional": true}
}, },
{ {
"name": "getBadgeBackgroundColor", "name": "getBadgeBackgroundColor",
...@@ -251,9 +248,9 @@ ...@@ -251,9 +248,9 @@
{ {
"name": "details", "name": "details",
"$ref": "TabDetails" "$ref": "TabDetails"
}, }
{ ],
"type": "function", "returns_async": {
"name": "callback", "name": "callback",
"parameters": [ "parameters": [
{ {
...@@ -262,7 +259,6 @@ ...@@ -262,7 +259,6 @@
} }
] ]
} }
]
}, },
{ {
"name": "enable", "name": "enable",
...@@ -275,9 +271,9 @@ ...@@ -275,9 +271,9 @@
"name": "tabId", "name": "tabId",
"minimum": 0, "minimum": 0,
"description": "The ID of the tab for which to modify the browser action." "description": "The ID of the tab for which to modify the browser action."
}, }
{"type": "function", "name": "callback", "parameters": [], "optional": true} ],
] "returns_async": {"name": "callback", "parameters": [], "optional": true}
}, },
{ {
"name": "disable", "name": "disable",
...@@ -290,9 +286,9 @@ ...@@ -290,9 +286,9 @@
"name": "tabId", "name": "tabId",
"minimum": 0, "minimum": 0,
"description": "The ID of the tab for which to modify the browser action." "description": "The ID of the tab for which to modify the browser action."
}, }
{"type": "function", "name": "callback", "parameters": [], "optional": true} ],
] "returns_async": {"name": "callback", "parameters": [], "optional": true}
}, },
{ {
"name": "openPopup", "name": "openPopup",
......
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