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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview A helper object used from the "Site Settings" section to 6 * @fileoverview A helper object used from the "Site Settings" section to
7 * interact with the content settings prefs. 7 * interact with the content settings prefs.
8 */ 8 */
9 9
10 /** 10 /**
(...skipping 28 matching lines...) Expand all
39 * id: string}} 39 * id: string}}
40 */ 40 */
41 var MediaPickerEntry; 41 var MediaPickerEntry;
42 42
43 /** 43 /**
44 * @typedef {{protocol: string, 44 * @typedef {{protocol: string,
45 * spec: string}} 45 * spec: string}}
46 */ 46 */
47 var ProtocolHandlerEntry; 47 var ProtocolHandlerEntry;
48 48
49 /**
50 * @typedef {{name: string,
51 * product-id: Number,
52 * serial-number: string,
53 * vendor-id: Number}}
54 */
55 var UsbDeviceDetails;
56
57 /**
58 * @typedef {{embeddingOrigin: string,
59 * object: UsbDeviceDetails,
60 * objectName: string,
61 * origin: string,
62 * setting: string,
63 * source: string}}
64 */
65 var UsbDeviceEntry;
66
49 cr.define('settings', function() { 67 cr.define('settings', function() {
50 /** @interface */ 68 /** @interface */
51 function SiteSettingsPrefsBrowserProxy() {} 69 function SiteSettingsPrefsBrowserProxy() {}
52 70
53 SiteSettingsPrefsBrowserProxy.prototype = { 71 SiteSettingsPrefsBrowserProxy.prototype = {
54 /** 72 /**
55 * Sets the default value for a site settings category. 73 * Sets the default value for a site settings category.
56 * @param {string} contentType The name of the category to change. 74 * @param {string} contentType The name of the category to change.
57 * @param {string} defaultValue The name of the value to set as default. 75 * @param {string} defaultValue The name of the value to set as default.
58 */ 76 */
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 * @param {string} url The url to use as the default. 171 * @param {string} url The url to use as the default.
154 */ 172 */
155 setProtocolDefault: function(protocol, url) {}, 173 setProtocolDefault: function(protocol, url) {},
156 174
157 /** 175 /**
158 * Deletes a certain protocol handler by url. 176 * Deletes a certain protocol handler by url.
159 * @param {string} protocol The protocol to delete the url from. 177 * @param {string} protocol The protocol to delete the url from.
160 * @param {string} url The url to delete. 178 * @param {string} url The url to delete.
161 */ 179 */
162 removeProtocolHandler: function(protocol, url) {}, 180 removeProtocolHandler: function(protocol, url) {},
181
182 /**
183 * Fetches a list of all USB devices and the sites permitted to use them.
184 * @return {!Promise<Array<UsbDeviceEntry>>} The list of USB devices.
185 */
186 fetchUsbDevices: function() {},
187
188 /**
189 * Removes a particular USB device object permission by origin and embedding
190 * origin.
191 * @param {string} origin The origin to look up the permission for.
192 * @param {string} embeddingOrigin the embedding origin to look up.
193 * @param {UsbDeviceDetails} usbDevice The USB device to revoke permission
194 * for.
195 */
196 removeUsbDevice: function(origin, embeddingOrigin, usbDevice) {},
163 }; 197 };
164 198
165 /** 199 /**
166 * @constructor 200 * @constructor
167 * @implements {settings.SiteSettingsPrefsBrowserProxy} 201 * @implements {settings.SiteSettingsPrefsBrowserProxy}
168 */ 202 */
169 function SiteSettingsPrefsBrowserProxyImpl() {} 203 function SiteSettingsPrefsBrowserProxyImpl() {}
170 204
171 // The singleton instance_ is replaced with a test version of this wrapper 205 // The singleton instance_ is replaced with a test version of this wrapper
172 // during testing. 206 // during testing.
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 277
244 /** @override */ 278 /** @override */
245 setProtocolDefault: function(protocol, url) { 279 setProtocolDefault: function(protocol, url) {
246 chrome.send('setDefault', [[protocol, url]]); 280 chrome.send('setDefault', [[protocol, url]]);
247 }, 281 },
248 282
249 /** @override */ 283 /** @override */
250 removeProtocolHandler: function(protocol, url) { 284 removeProtocolHandler: function(protocol, url) {
251 chrome.send('removeHandler', [[protocol, url]]); 285 chrome.send('removeHandler', [[protocol, url]]);
252 }, 286 },
287
288 /** @override */
289 fetchUsbDevices: function() {
290 return cr.sendWithPromise('fetchUsbDevices');
291 },
292
293 /** @override */
294 removeUsbDevice: function(origin, embeddingOrigin, usbDevice) {
295 chrome.send('removeUsbDevice', [origin, embeddingOrigin, usbDevice]);
296 },
253 }; 297 };
254 298
255 return { 299 return {
256 SiteSettingsPrefsBrowserProxy: SiteSettingsPrefsBrowserProxy, 300 SiteSettingsPrefsBrowserProxy: SiteSettingsPrefsBrowserProxy,
257 SiteSettingsPrefsBrowserProxyImpl: SiteSettingsPrefsBrowserProxyImpl, 301 SiteSettingsPrefsBrowserProxyImpl: SiteSettingsPrefsBrowserProxyImpl,
258 }; 302 };
259 }); 303 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698