OLD | NEW |
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 | 6 * @fileoverview |
7 * 'usb-devices' is the polymer element for showing the USB Devices category | 7 * 'usb-devices' is the polymer element for showing the USB Devices category |
8 * under Site Settings. | 8 * under Site Settings. |
9 */ | 9 */ |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 /** @override */ | 30 /** @override */ |
31 ready: function() { | 31 ready: function() { |
32 this.fetchUsbDevices_(); | 32 this.fetchUsbDevices_(); |
33 }, | 33 }, |
34 | 34 |
35 /** | 35 /** |
36 * Fetch the list of USB devices and update the list. | 36 * Fetch the list of USB devices and update the list. |
37 * @private | 37 * @private |
38 */ | 38 */ |
39 fetchUsbDevices_: function() { | 39 fetchUsbDevices_: function() { |
40 this.browserProxy.fetchUsbDevices().then(function(deviceList) { | 40 this.browserProxy.fetchUsbDevices().then(deviceList => { |
41 this.devices_ = deviceList; | 41 this.devices_ = deviceList; |
42 }.bind(this)); | 42 }); |
43 }, | 43 }, |
44 | 44 |
45 /** | 45 /** |
46 * @return {boolean} | 46 * @return {boolean} |
47 * @private | 47 * @private |
48 */ | 48 */ |
49 hasDevices_: function() { | 49 hasDevices_: function() { |
50 return !!(this.devices_ && this.devices_.length); | 50 return !!(this.devices_ && this.devices_.length); |
51 }, | 51 }, |
52 | 52 |
(...skipping 17 matching lines...) Expand all Loading... |
70 * @private | 70 * @private |
71 */ | 71 */ |
72 showMenu_: function(event) { | 72 showMenu_: function(event) { |
73 this.actionMenuModel_ = event.model.item; | 73 this.actionMenuModel_ = event.model.item; |
74 /** @type {!CrActionMenuElement} */ (this.$$('dialog[is=cr-action-menu]')) | 74 /** @type {!CrActionMenuElement} */ (this.$$('dialog[is=cr-action-menu]')) |
75 .showAt( | 75 .showAt( |
76 /** @type {!Element} */ ( | 76 /** @type {!Element} */ ( |
77 Polymer.dom(/** @type {!Event} */ (event)).localTarget)); | 77 Polymer.dom(/** @type {!Event} */ (event)).localTarget)); |
78 } | 78 } |
79 }); | 79 }); |
OLD | NEW |