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

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

Issue 249913002: FIDO U2F component extension (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with HEAD Created 6 years, 7 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
(Empty)
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6 * @fileoverview Contains a simple factory for creating and opening usbGnubby
7 * instances.
8 * @author juanlang@google.com (Juan Lang)
9 */
10 'use strict';
11
12 /**
13 * @param {Gnubbies} gnubbies
14 * @constructor
15 * @implements {GnubbyFactory}
16 */
17 function UsbGnubbyFactory(gnubbies) {
18 /** @private {Gnubbies} */
19 this.gnubbies_ = gnubbies;
20 usbGnubby.setGnubbies(gnubbies);
21 }
22
23 /**
24 * Creates a new gnubby object, and opens the gnubby with the given index.
25 * @param {llGnubbyDeviceId} which The device to open.
26 * @param {boolean} forEnroll Whether this gnubby is being opened for enrolling.
27 * @param {function(number, usbGnubby=)} cb Called with result of opening the
28 * gnubby.
29 * @param {string=} logMsgUrl the url to post log messages to
30 * @override
31 */
32 UsbGnubbyFactory.prototype.openGnubby =
33 function(which, forEnroll, cb, logMsgUrl) {
34 var gnubby = new usbGnubby();
35 gnubby.open(which, function(rc) {
36 cb(rc, gnubby);
37 });
38 };
39
40 /**
41 * Enumerates gnubbies.
42 * @param {function(number, Array.<llGnubbyDeviceId>)} cb
43 */
44 UsbGnubbyFactory.prototype.enumerate = function(cb) {
45 this.gnubbies_.enumerate(cb);
46 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/cryptotoken/usbenrollhelper.js ('k') | chrome/browser/resources/cryptotoken/usbsignhelper.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698