| OLD | NEW |
| (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 USB Devices category |
| 8 * under Site Settings. |
| 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 this.browserProxy.removeUsbDevice( |
| 46 item.origin, item.embeddingOrigin, item.object); |
| 47 this.fetchUsbDevices_(); |
| 48 }, |
| 49 }); |
| OLD | NEW |