Chromium Code Reviews| Index: chrome/browser/resources/settings/site_settings/usb_devices.js |
| diff --git a/chrome/browser/resources/settings/site_settings/usb_devices.js b/chrome/browser/resources/settings/site_settings/usb_devices.js |
| index 836bdf66b35a07912d28f4af81c677a3d0e454e5..da66fbe3efb4fccd1ebf88da393d2c818bb6cdb5 100644 |
| --- a/chrome/browser/resources/settings/site_settings/usb_devices.js |
| +++ b/chrome/browser/resources/settings/site_settings/usb_devices.js |
| @@ -19,6 +19,11 @@ Polymer({ |
| * @type {Array<UsbDeviceEntry>} |
| */ |
| devices: Array, |
|
dpapad
2016/11/08 01:53:49
!Array<!UsbDeviceEntry>
Also, can we turn this in
scottchen
2016/11/09 19:20:56
Done.
|
| + /** |
|
dschuyler
2016/11/08 01:48:41
Please add a blank line before the /**.
scottchen
2016/11/09 19:20:56
Done.
|
| + * The targetted object for menu operations. |
| + * @type {?Object} |
| + */ |
| + actionMenuModel: Object |
|
dpapad
2016/11/08 01:53:49
Since this is only used within this file, let's do
scottchen
2016/11/09 19:20:56
Done.
|
| }, |
| ready: function() { |
| @@ -40,10 +45,18 @@ Polymer({ |
| * @param {!{model: !{item: UsbDeviceEntry}}} event |
| * @private |
| */ |
| - onActionMenuIronActivate_: function(event) { |
| - var item = event.model.item; |
| + onRemoveTap_: function(event) { |
|
dpapad
2016/11/08 01:53:49
|event| is no longer used in this method, let's re
scottchen
2016/11/09 19:20:56
Done.
|
| + var item = this.actionMenuModel; |
| this.browserProxy.removeUsbDevice( |
| item.origin, item.embeddingOrigin, item.object); |
| + this.actionMenuModel = null; |
| this.fetchUsbDevices_(); |
| }, |
|
dschuyler
2016/11/08 01:48:40
Please add a blank line here.
dpapad
2016/11/08 01:53:49
Add a blank line between functions.
scottchen
2016/11/09 19:20:56
Done.
scottchen
2016/11/09 19:20:56
Done.
|
| + showMenu_: function(event) { |
|
dschuyler
2016/11/08 01:48:41
Please add an @param for |event|.
Something like t
dpapad
2016/11/08 01:53:49
Need @private and @param annotation.
scottchen
2016/11/09 19:20:56
Done.
scottchen
2016/11/09 19:20:56
Done.
|
| + this.actionMenuModel = event.model.item; |
| + /** @type {!CrActionMenuElement} */ ( |
| + this.$$('dialog[is=cr-action-menu]')).showAt( |
| + /** @type {!Element} */ ( |
| + Polymer.dom(/** @type {!Event} */ (event)).localTarget)); |
| + } |
| }); |