Chromium Code Reviews| 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 { |
| 11 HMAC_SHA256, | 11 HMAC_SHA256, |
| 12 ECDSA_P256_SHA256 | 12 ECDSA_P256_SHA256 |
| 13 }; | 13 }; |
| 14 | 14 |
| 15 // Encryption algorithms supported by the crypto library methods used by | 15 // Encryption algorithms supported by the crypto library methods used by |
| 16 // Easy Unlock. | 16 // Easy Unlock. |
| 17 enum EncryptionType { | 17 enum EncryptionType { |
| 18 AES_256_CBC | 18 AES_256_CBC |
| 19 }; | 19 }; |
| 20 | 20 |
| 21 // Available states for the Easy Unlock app. | |
| 22 enum State { | |
| 23 // Screen is either not locked, or the Easy Unlock is not enabled. | |
| 24 INACTIVE, | |
| 25 // The Bluetooth is not enabled. | |
| 26 NO_BLUETOOTH, | |
| 27 // Bluetooth is being activated. | |
| 28 BLUETOOTH_CONNECTING, | |
| 29 // There are no phones eligible to unlock the device. | |
| 30 NO_PHONE, | |
| 31 // A phone eligible to unlock the device is detected, but can't be | |
| 32 // authenticated. | |
| 33 PHONE_NOT_AUTHENTICATED, | |
| 34 // A phone eligible to unlock the device is detected, but it's locked and | |
| 35 // thus unable to unlock the device. | |
| 36 PHONE_LOCKED, | |
| 37 // A phone eligible to unlock the devioce is detected, but it is not allowed | |
|
xiyuan
2014/08/12 18:09:47
nit: devioce -> device
tbarzic
2014/08/12 19:14:36
Done.
| |
| 38 // to unlock the device because it doesn't have lock screen enabled. | |
| 39 PHONE_UNLOCKABLE, | |
| 40 // A phone eligible to unlock the device is detected, but it's not close | |
| 41 // enough to be allowed to unlock the device. | |
| 42 PHONE_NOT_NEARBY, | |
| 43 // The devie can be unlocked using Easy Unlock. | |
| 44 AUTHENTICATED | |
| 45 }; | |
| 46 | |
| 21 // Options that can be passed to |unwrapSecureMessage| method. | 47 // Options that can be passed to |unwrapSecureMessage| method. |
| 22 dictionary UnwrapSecureMessageOptions { | 48 dictionary UnwrapSecureMessageOptions { |
| 23 // The data associated with the message. For the message to be succesfully | 49 // The data associated with the message. For the message to be succesfully |
| 24 // verified, the message should have been created with the same associated | 50 // verified, the message should have been created with the same associated |
| 25 // data. | 51 // data. |
| 26 ArrayBuffer? associatedData; | 52 ArrayBuffer? associatedData; |
| 27 | 53 |
| 28 // The encryption algorithm that should be used to decrypt the message. | 54 // The encryption algorithm that should be used to decrypt the message. |
| 29 // Should not be set for a cleartext message. | 55 // Should not be set for a cleartext message. |
| 30 EncryptionType? encryptType; | 56 EncryptionType? encryptType; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 138 // Connects to the SDP service on a device, given just the device's | 164 // Connects to the SDP service on a device, given just the device's |
| 139 // Bluetooth address. This function is useful as a faster alternative to | 165 // Bluetooth address. This function is useful as a faster alternative to |
| 140 // Bluetooth discovery, when you already know the remote device's Bluetooth | 166 // Bluetooth discovery, when you already know the remote device's Bluetooth |
| 141 // address. A successful call to this function has the side-effect of | 167 // address. A successful call to this function has the side-effect of |
| 142 // registering the device with the Bluetooth daemon, making it available for | 168 // registering the device with the Bluetooth daemon, making it available for |
| 143 // future outgoing connections. | 169 // future outgoing connections. |
| 144 // |deviceAddress|: The Bluetooth address of the device to connect to. | 170 // |deviceAddress|: The Bluetooth address of the device to connect to. |
| 145 // |callback|: Called to indicate success or failure. | 171 // |callback|: Called to indicate success or failure. |
| 146 static void seekBluetoothDeviceByAddress(DOMString deviceAddress, | 172 static void seekBluetoothDeviceByAddress(DOMString deviceAddress, |
| 147 optional EmptyCallback callback); | 173 optional EmptyCallback callback); |
| 174 | |
| 175 // Updates the screenlock state to reflect the Easy Unlock app state. | |
| 176 static void updateScreenlockState(State state, | |
| 177 optional EmptyCallback callback); | |
| 148 }; | 178 }; |
| 149 }; | 179 }; |
| OLD | NEW |