| OLD | NEW |
| 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 Contains a simple factory for creating and opening Gnubby | 6 * @fileoverview Contains a simple factory for creating and opening Gnubby |
| 7 * instances. | 7 * instances. |
| 8 */ | 8 */ |
| 9 'use strict'; | 9 'use strict'; |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 return; | 36 return; |
| 37 } | 37 } |
| 38 gnubby.sync(function(rc) { | 38 gnubby.sync(function(rc) { |
| 39 cb(rc, gnubby); | 39 cb(rc, gnubby); |
| 40 }); | 40 }); |
| 41 }); | 41 }); |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 /** | 44 /** |
| 45 * Enumerates gnubbies. | 45 * Enumerates gnubbies. |
| 46 * @param {function(number, Array.<GnubbyDeviceId>)} cb Enumerate callback | 46 * @param {function(number, Array<GnubbyDeviceId>)} cb Enumerate callback |
| 47 */ | 47 */ |
| 48 UsbGnubbyFactory.prototype.enumerate = function(cb) { | 48 UsbGnubbyFactory.prototype.enumerate = function(cb) { |
| 49 this.gnubbies_.enumerate(cb); | 49 this.gnubbies_.enumerate(cb); |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 /** | 52 /** |
| 53 * No-op prerequisite check. | 53 * No-op prerequisite check. |
| 54 * @param {Gnubby} gnubby The not-enrolled gnubby. | 54 * @param {Gnubby} gnubby The not-enrolled gnubby. |
| 55 * @param {string} appIdHash The base64-encoded hash of the app id for which | 55 * @param {string} appIdHash The base64-encoded hash of the app id for which |
| 56 * the gnubby being enrolled. | 56 * the gnubby being enrolled. |
| 57 * @param {FactoryOpenCallback} cb Called with the result of the prerequisite | 57 * @param {FactoryOpenCallback} cb Called with the result of the prerequisite |
| 58 * check. (A non-zero status indicates failure.) | 58 * check. (A non-zero status indicates failure.) |
| 59 */ | 59 */ |
| 60 UsbGnubbyFactory.prototype.notEnrolledPrerequisiteCheck = | 60 UsbGnubbyFactory.prototype.notEnrolledPrerequisiteCheck = |
| 61 function(gnubby, appIdHash, cb) { | 61 function(gnubby, appIdHash, cb) { |
| 62 cb(DeviceStatusCodes.OK_STATUS, gnubby); | 62 cb(DeviceStatusCodes.OK_STATUS, gnubby); |
| 63 }; | 63 }; |
| OLD | NEW |