Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2779)

Unified Diff: chrome/browser/resources/settings/site_settings/site_settings_prefs_browser_proxy.js

Issue 2237823003: Site Settings Desktop: Implement USB devices section. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 37fcce621cb05d7fdcbcba6bb1795f0c0662f0b9..bf037b46d8b6347800c98a7b988be42b20b4805a 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
@@ -46,6 +46,24 @@ var MediaPickerEntry;
*/
var ProtocolHandlerEntry;
+/**
+ * @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() {}
@@ -160,6 +178,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} usbDevice The USB device to revoke permission
+ * for.
+ */
+ removeUsbDevice: function(origin, embeddingOrigin, usbDevice) {},
};
/**
@@ -250,6 +284,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, usbDevice) {
+ chrome.send('removeUsbDevice', [origin, embeddingOrigin, usbDevice]);
+ },
};
return {

Powered by Google App Engine
This is Rietveld 408576698