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

Side by Side Diff: chrome/browser/resources/cryptotoken/gnubbydevice.js

Issue 917093003: Shorten Closure template notation from Array.<*> to Array<*>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove cvox Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 Interface for representing a low-level gnubby device. 6 * @fileoverview Interface for representing a low-level gnubby device.
7 */ 7 */
8 'use strict'; 8 'use strict';
9 9
10 /** 10 /**
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 /** 114 /**
115 * @typedef {{ 115 * @typedef {{
116 * vendorId: number, 116 * vendorId: number,
117 * productId: number 117 * productId: number
118 * }} 118 * }}
119 */ 119 */
120 var UsbDeviceSpec; 120 var UsbDeviceSpec;
121 121
122 /** 122 /**
123 * Gets the list of USB devices permitted by this app. 123 * Gets the list of USB devices permitted by this app.
124 * @param {function(!Array.<!UsbDeviceSpec>)} cb Called back with a list of USB 124 * @param {function(!Array<!UsbDeviceSpec>)} cb Called back with a list of USB
125 * device specifiers. 125 * device specifiers.
126 */ 126 */
127 GnubbyDevice.getPermittedUsbDevices = function(cb) { 127 GnubbyDevice.getPermittedUsbDevices = function(cb) {
128 chrome.permissions.getAll(function(perms) { 128 chrome.permissions.getAll(function(perms) {
129 if (!perms.hasOwnProperty('permissions')) { 129 if (!perms.hasOwnProperty('permissions')) {
130 cb([]); 130 cb([]);
131 return; 131 return;
132 } 132 }
133 var devs = []; 133 var devs = [];
134 var permissions = perms['permissions']; 134 var permissions = perms['permissions'];
135 for (var i = 0; i < permissions.length; i++) { 135 for (var i = 0; i < permissions.length; i++) {
136 var permission = permissions[i]; 136 var permission = permissions[i];
137 if (typeof permission === 'object' && 137 if (typeof permission === 'object' &&
138 permission.hasOwnProperty('usbDevices')) { 138 permission.hasOwnProperty('usbDevices')) {
139 for (var j = 0; j < permission['usbDevices'].length; j++) { 139 for (var j = 0; j < permission['usbDevices'].length; j++) {
140 var dev = permission['usbDevices'][j]; 140 var dev = permission['usbDevices'][j];
141 devs.push( 141 devs.push(
142 {'vendorId': dev['vendorId'], 'productId': dev['productId']}); 142 {'vendorId': dev['vendorId'], 'productId': dev['productId']});
143 } 143 }
144 } 144 }
145 } 145 }
146 cb(devs); 146 cb(devs);
147 }); 147 });
148 }; 148 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/cryptotoken/gnubby-u2f.js ('k') | chrome/browser/resources/cryptotoken/gnubbyfactory.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698