| 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 // <code>chrome.easyUnlockPrivate</code> API that provides hooks to Chrome to | 5 // <code>chrome.easyUnlockPrivate</code> API that provides hooks to Chrome to |
| 6 // be used by Easy Unlock component app. | 6 // be used by Easy Unlock component app. |
| 7 [nodoc] namespace easyUnlockPrivate { | 7 [nodoc] namespace easyUnlockPrivate { |
| 8 // Signature algorithms supported by the crypto library methods used by | 8 // Signature algorithms supported by the crypto library methods used by |
| 9 // Easy Unlock. | 9 // Easy Unlock. |
| 10 enum SignatureType { | 10 enum SignatureType { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // The name of the device. | 122 // The name of the device. |
| 123 DOMString? name; | 123 DOMString? name; |
| 124 | 124 |
| 125 // The permit record of the device. | 125 // The permit record of the device. |
| 126 PermitRecord? permitRecord; | 126 PermitRecord? permitRecord; |
| 127 | 127 |
| 128 // Websafe base64 encoded persistent symmetric key. | 128 // Websafe base64 encoded persistent symmetric key. |
| 129 DOMString? psk; | 129 DOMString? psk; |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 // The information about a user associated with Easy unlock service. |
| 133 dictionary UserInfo { |
| 134 // The user id. |
| 135 DOMString userId; |
| 136 |
| 137 // Whether the user is logged in. If not logged in, the app is running on |
| 138 // the signin screen. |
| 139 boolean loggedIn; |
| 140 |
| 141 // Whether all data needed to use Easy unlock service has been loaded for |
| 142 // the user. |
| 143 boolean dataReady; |
| 144 }; |
| 145 |
| 132 // Callback for crypto methods that return a single array buffer. | 146 // Callback for crypto methods that return a single array buffer. |
| 133 callback DataCallback = void(optional ArrayBuffer data); | 147 callback DataCallback = void(optional ArrayBuffer data); |
| 134 | 148 |
| 135 // An empty callback used purely for signalling success vs. failure. | 149 // An empty callback used purely for signalling success vs. failure. |
| 136 callback EmptyCallback = void(); | 150 callback EmptyCallback = void(); |
| 137 | 151 |
| 138 // Callback for the getStrings() method. | 152 // Callback for the getStrings() method. |
| 139 callback GetStringsCallback = void(object strings); | 153 callback GetStringsCallback = void(object strings); |
| 140 | 154 |
| 141 // Callback for method that generates an encryption key pair. | 155 // Callback for method that generates an encryption key pair. |
| 142 callback KeyPairCallback = void(optional ArrayBuffer public_key, | 156 callback KeyPairCallback = void(optional ArrayBuffer public_key, |
| 143 optional ArrayBuffer private_key); | 157 optional ArrayBuffer private_key); |
| 144 | 158 |
| 145 // Callback for the getPermitAccess() method. | 159 // Callback for the getPermitAccess() method. |
| 146 callback GetPermitAccessCallback = void(optional PermitRecord permitAccess); | 160 callback GetPermitAccessCallback = void(optional PermitRecord permitAccess); |
| 147 | 161 |
| 148 // Callback for the getRemoteDevices() method. | 162 // Callback for the getRemoteDevices() method. |
| 149 callback GetRemoteDevicesCallback = void(Device[] devices); | 163 callback GetRemoteDevicesCallback = void(Device[] devices); |
| 150 | 164 |
| 165 // Callback for the |getUserInfo()| method. Note that the callback argument is |
| 166 // a list for future use (on signin screen there may be more than one user |
| 167 // associated with the easy unlock service). Currently the method returns at |
| 168 // most one user. |
| 169 callback GetUserInfoCallback = void(UserInfo[] users); |
| 170 |
| 151 interface Functions { | 171 interface Functions { |
| 152 // Gets localized strings required to render the API. | 172 // Gets localized strings required to render the API. |
| 153 // | 173 // |
| 154 // |callback| : Called with a dictionary mapping names to resource strings. | 174 // |callback| : Called with a dictionary mapping names to resource strings. |
| 155 // TODO(isherman): This is essentially copied from identity_private.idl. | 175 // TODO(isherman): This is essentially copied from identity_private.idl. |
| 156 // Perhaps this should be extracted to a common API instead? | 176 // Perhaps this should be extracted to a common API instead? |
| 157 static void getStrings(GetStringsCallback callback); | 177 static void getStrings(GetStringsCallback callback); |
| 158 | 178 |
| 159 // Generates a ECDSA key pair for P256 curve. | 179 // Generates a ECDSA key pair for P256 curve. |
| 160 // Public key will be in format recognized by secure wire transport protocol | 180 // Public key will be in format recognized by secure wire transport protocol |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 static void getRemoteDevices(GetRemoteDevicesCallback callback); | 281 static void getRemoteDevices(GetRemoteDevicesCallback callback); |
| 262 | 282 |
| 263 // Gets the sign-in challenge for the current user. | 283 // Gets the sign-in challenge for the current user. |
| 264 static void getSignInChallenge(DataCallback callback); | 284 static void getSignInChallenge(DataCallback callback); |
| 265 | 285 |
| 266 // Tries to sign-in the current user with a secret obtained by decrypting | 286 // Tries to sign-in the current user with a secret obtained by decrypting |
| 267 // the sign-in challenge. Check chrome.runtime.lastError for failures. Upon | 287 // the sign-in challenge. Check chrome.runtime.lastError for failures. Upon |
| 268 // success, the user session will be started. | 288 // success, the user session will be started. |
| 269 static void trySignInSecret(ArrayBuffer signInSecret, | 289 static void trySignInSecret(ArrayBuffer signInSecret, |
| 270 EmptyCallback callback); | 290 EmptyCallback callback); |
| 291 |
| 292 // Retrieves information about the user associated with the Easy unlock |
| 293 // service. |
| 294 static void getUserInfo(GetUserInfoCallback callback); |
| 295 }; |
| 296 |
| 297 interface Events { |
| 298 // Event fired when the data for the user currently associated with |
| 299 // Easy unlock service is updated. |
| 300 // |userInfo| The updated user information. |
| 301 static void onUserInfoUpdated(UserInfo userInfo); |
| 271 }; | 302 }; |
| 272 }; | 303 }; |
| OLD | NEW |