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

Unified 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 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
new file mode 100644
index 0000000000000000000000000000000000000000..523078f5e0cd669af5de17f935e92a35113ab2e8
--- /dev/null
+++ b/chrome/browser/resources/settings/site_settings/usb_devices.js
@@ -0,0 +1,50 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @fileoverview
+ * 'usb-devices' is the polymer element for showing the
+ * 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.
+ */
+
+Polymer({
+ is: 'usb-devices',
+
+ behaviors: [SiteSettingsBehavior],
+
+ properties: {
+ /**
+ * A list of all USB devices.
+ * @type {Array<UsbDeviceEntry>}
+ */
+ devices: Array,
+ },
+
+ ready: function() {
+ this.fetchUsbDevices_();
+ },
+
+ /**
+ * Fetch the list of USB devices and update the list.
+ * @private
+ */
+ fetchUsbDevices_: function() {
+ this.browserProxy.fetchUsbDevices().then(function(deviceList) {
+ this.devices = deviceList;
+ }.bind(this));
+ },
+
+ /**
+ * A handler when an action is selected in the action menu.
+ * @param {!{model: !{item: UsbDeviceEntry}}} event
+ * @private
+ */
+ onActionMenuIronActivate_: function(event) {
+ var item = event.model.item;
+ console.log(item);
dschuyler 2016/08/11 23:28:07 Please remove the console.log.
Finnur 2016/08/12 13:11:26 Oops, done.
+ this.browserProxy.removeUsbDevice(
+ item.origin, item.embeddingOrigin, item.object);
+ this.fetchUsbDevices_();
+ },
+});

Powered by Google App Engine
This is Rietveld 408576698