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

Side by Side Diff: chrome/browser/resources/settings/site_settings/usb_devices.js

Issue 2237823003: Site Settings Desktop: Implement USB devices section. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
(Empty)
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
3 // found in the LICENSE file.
4
5 /**
6 * @fileoverview
7 * 'usb-devices' is the polymer element for showing the
8 * USB Devices category under Site Settings.
dschuyler 2016/08/11 23:28:07 nit: more of this line could go on the line above.
Finnur 2016/08/12 13:11:26 Done.
9 */
10
11 Polymer({
12 is: 'usb-devices',
13
14 behaviors: [SiteSettingsBehavior],
15
16 properties: {
17 /**
18 * A list of all USB devices.
19 * @type {Array<UsbDeviceEntry>}
20 */
21 devices: Array,
22 },
23
24 ready: function() {
25 this.fetchUsbDevices_();
26 },
27
28 /**
29 * Fetch the list of USB devices and update the list.
30 * @private
31 */
32 fetchUsbDevices_: function() {
33 this.browserProxy.fetchUsbDevices().then(function(deviceList) {
34 this.devices = deviceList;
35 }.bind(this));
36 },
37
38 /**
39 * A handler when an action is selected in the action menu.
40 * @param {!{model: !{item: UsbDeviceEntry}}} event
41 * @private
42 */
43 onActionMenuIronActivate_: function(event) {
44 var item = event.model.item;
45 console.log(item);
dschuyler 2016/08/11 23:28:07 Please remove the console.log.
Finnur 2016/08/12 13:11:26 Oops, done.
46 this.browserProxy.removeUsbDevice(
47 item.origin, item.embeddingOrigin, item.object);
48 this.fetchUsbDevices_();
49 },
50 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698