Chromium Code Reviews| Index: chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.js |
| diff --git a/chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.js b/chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.js |
| index c944ccdcbb62ce21287b5b680e13d26adcfbf7b1..ce9e38d8cb0d5942a888b39267c583b51caadfee 100644 |
| --- a/chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.js |
| +++ b/chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.js |
| @@ -40,6 +40,24 @@ var SiteSettingsPref; |
| */ |
| var MediaPickerEntry; |
| +/** |
| + * @typedef {{name: string, |
| + * product-id: Number, |
| + * serial-number: string, |
| + * vendor-id: Number}} |
| + */ |
| +var UsbDeviceDetails; |
| + |
| +/** |
| + * @typedef {{embeddingOrigin: string, |
| + * object: UsbDeviceDetails, |
| + * objectName: string, |
| + * origin: string, |
| + * setting: string, |
| + * source: string}} |
| + */ |
| +var UsbDeviceEntry; |
| + |
| cr.define('settings', function() { |
| /** @interface */ |
| function SiteSettingsPrefsBrowserProxy() {} |
| @@ -154,6 +172,22 @@ cr.define('settings', function() { |
| * @param {string} url The url to delete. |
| */ |
| removeProtocolHandler: function(protocol, url) {}, |
| + |
| + /** |
| + * Fetches a list of all USB devices and the sites permitted to use them. |
| + * @return {!Promise<Array<UsbDeviceEntry>>} The list of USB devices. |
| + */ |
| + fetchUsbDevices: function() {}, |
| + |
| + /** |
| + * Removes a particular USB device object permission by origin and embedding |
| + * origin. |
| + * @param {string} origin The origin to look up the permission for. |
| + * @param {string} embeddingOrigin the embedding origin to look up. |
| + * @param {UsbDeviceDetails} object The USB device object to revoke |
|
dschuyler
2016/08/11 23:28:07
nit: how about the name |usbDevice| instead of |ob
Finnur
2016/08/12 13:11:26
I like that idea.
|
| + * permission for. |
| + */ |
| + removeUsbDevice: function(origin, embeddingOrigin, object) {}, |
| }; |
| /** |
| @@ -244,6 +278,16 @@ cr.define('settings', function() { |
| removeProtocolHandler: function(protocol, url) { |
| chrome.send('removeHandler', [[protocol, url]]); |
| }, |
| + |
| + /** @override */ |
| + fetchUsbDevices: function() { |
| + return cr.sendWithPromise('fetchUsbDevices'); |
| + }, |
| + |
| + /** @override */ |
| + removeUsbDevice: function(origin, embeddingOrigin, object) { |
|
dschuyler
2016/08/11 23:28:07
Nit: is there another param name we can use other
Finnur
2016/08/12 13:11:26
Done.
|
| + chrome.send('removeUsbDevice', [origin, embeddingOrigin, object]); |
| + }, |
| }; |
| return { |