Skip to content

Commit

Permalink
add undocumented chrome.dial API
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandr-oleynikov committed Apr 28, 2017
1 parent 0ce2635 commit 35def48
Show file tree
Hide file tree
Showing 3 changed files with 145 additions and 0 deletions.
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ chrome.registerPlugin(new CookiePlugin());
* [chrome.declarativeContent](https://developer.chrome.com/extensions/declarativeContent)
* [chrome.desktopCapture](https://developer.chrome.com/extensions/desktopCapture)
* [chrome.devtools](https://developer.chrome.com/extensions/devtools)
* [chrome.dial](https://chromium.googlesource.com/chromium/src.git/+/master/chrome/common/extensions/api/dial.idl) (undocumented API for communication with DIAL-capable devices)
* [chrome.downloads](https://developer.chrome.com/extensions/downloads)
* [chrome.extension](https://developer.chrome.com/extensions/extension)
* [chrome.extensionTypes](https://developer.chrome.com/extensions/extensionTypes)
Expand Down
133 changes: 133 additions & 0 deletions src/config/stable-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -3894,6 +3894,139 @@
"manifest:devtools_page"
]
},
{
"types": [
{
"id": "DialDevice",
"type": "object",
"properties": {
"deviceLabel": {
"type": "string"
},
"deviceDescriptionUrl": {
"type": "string"
},
"configId": {
"type": "integer",
"nullable": true
}
}
},
{
"id": "DialDeviceDescription",
"type": "object",
"properties": {
"deviceLabel": {
"type": "string"
},
"appUrl": {
"type": "string"
},
"deviceDescription": {
"type": "string"
}
}
},
{
"id": "DialErrorCode",
"type": "string",
"enum": [
"no_listeners",
"no_valid_network_interfaces",
"network_disconnected",
"cellular_network",
"socket_error",
"unknown"
]
},
{
"id": "DialError",
"type": "object",
"properties": {
"code": {
"$ref": "DialErrorCode"
}
}
}
],
"functions": [
{
"name": "discoverNow",
"type": "function",
"parameters": [
{
"optional": false,
"name": "callback",
"type": "function",
"parameters": [
{
"type": "boolean",
"optional": false,
"name": "result"
}
]
}
],
"static": true
},
{
"name": "fetchDeviceDescription",
"type": "function",
"parameters": [
{
"type": "string",
"optional": false,
"name": "deviceLabel"
},
{
"optional": false,
"name": "callback",
"type": "function",
"parameters": [
{
"$ref": "DialDeviceDescription",
"optional": false,
"name": "result"
}
]
}
],
"static": true
}
],
"events": [
{
"name": "onDeviceList",
"type": "function",
"parameters": [
{
"type": "array",
"items": {
"$ref": "DialDevice"
},
"optional": false,
"name": "result"
}
]
},
{
"name": "onError",
"type": "function",
"parameters": [
{
"$ref": "DialError",
"optional": false,
"name": "error"
}
]
}
],
"namespace": "dial",
"description": "Use the <code>chrome.dial</code> API to discover devices that support DIAL. Protocol specification: http://www.dial-multiscreen.org/",
"dependencies": [
"permission:dial"
]
},
{
"types": [
{
Expand Down
11 changes: 11 additions & 0 deletions test/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,17 @@ export default {
'onSelectionChanged'
]
},
dial: {
methods: [
'discoverNow',
'fetchDeviceDescription'
],
properties: [],
events: [
'onDeviceList',
'onError'
]
},
downloads: {
methods: [
'download',
Expand Down

0 comments on commit 35def48

Please sign in to comment.