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

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: Address feedback 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..836bdf66b35a07912d28f4af81c677a3d0e454e5
--- /dev/null
+++ b/chrome/browser/resources/settings/site_settings/usb_devices.js
@@ -0,0 +1,49 @@
+// 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.
+ */
+
+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;
+ this.browserProxy.removeUsbDevice(
+ item.origin, item.embeddingOrigin, item.object);
+ this.fetchUsbDevices_();
+ },
+});

Powered by Google App Engine
This is Rietveld 408576698