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

Unified Diff: chrome/browser/resources/settings/site_settings/usb_devices.js

Issue 2480843003: change site-settings -> usb-device to use cr-action-menu instead of paper-menu (Closed)
Patch Set: add annotation to fix closure_compiler Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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));
+ }
});

Powered by Google App Engine
This is Rietveld 408576698