Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / common / extensions / api / easy_unlock_private.idl
index 1648853..6c7c2b7 100644 (file)
     // A phone eligible to unlock the device is detected, but it is not allowed
     // to unlock the device because it doesn't have lock screen enabled.
     PHONE_UNLOCKABLE,
-    // A phone eligible to unlock the device is detected, but it's not close
-    // enough to be allowed to unlock the device.
-    PHONE_NOT_NEARBY,
+    // A phone eligible to unlock the device is detected, but it is not allowed
+    // to unlock the device because it does not report its lock screen state.
+    PHONE_UNSUPPORTED,
+    // A phone eligible to unlock the device is detected, but its received
+    // signal strength is too low, i.e. the phone is roughly more than 30 feet
+    // away, and therefore is not allowed to unlock the device.
+    RSSI_TOO_LOW,
+    // A phone eligible to unlock the device is found, but the local device's
+    // transmission power is too high, indicating that the phone is (probably)
+    // more than 1 foot away, and therefore is not allowed to unlock the device.
+    TX_POWER_TOO_HIGH,
     // The devie can be unlocked using Easy Unlock.
     AUTHENTICATED
   };
     ArrayBuffer? publicMetadata;
 
     // Verification key id added to the message header. Should be set if the
-    // message is signed using |ECDSA_P256_SHA256|. It's used by the message
+    // message is signed using |ECDSA_P256_SHA256|. Used by the message
     // recepient to determine which key should be used to verify the message
     // signature.
     ArrayBuffer? verificationKeyId;
 
+    // Decryption key id added to the message header. Used by the message
+    // recepient to determine which key should be used to decrypt the message.
+    ArrayBuffer? decryptionKeyId;
+
     // The encryption algorithm that should be used to encrypt the message.
     // Should not be set for a cleartext message.
     EncryptionType? encryptType;
     DOMString? psk;
   };
 
+  // The information about a user associated with Easy unlock service.
+  dictionary UserInfo {
+    // The user id.
+    DOMString userId;
+
+    // Whether the user is logged in. If not logged in, the app is running on
+    // the signin screen.
+    boolean loggedIn;
+
+    // Whether all data needed to use Easy unlock service has been loaded for
+    // the user.
+    boolean dataReady;
+  };
+
   // Callback for crypto methods that return a single array buffer.
   callback DataCallback = void(optional ArrayBuffer data);
 
   // Callback for the getRemoteDevices() method.
   callback GetRemoteDevicesCallback = void(Device[] devices);
 
+  // Callback for the |getUserInfo()| method. Note that the callback argument is
+  // a list for future use (on signin screen there may be more than one user
+  // associated with the easy unlock service). Currently the method returns at
+  // most one user.
+  callback GetUserInfoCallback = void(UserInfo[] users);
+
   interface Functions {
     // Gets localized strings required to render the API.
     //
     static void seekBluetoothDeviceByAddress(DOMString deviceAddress,
                                              optional EmptyCallback callback);
 
+    // Connects the socket to a remote Bluetooth device over an insecure
+    // connection, i.e. a connection that requests no bonding and no
+    // man-in-the-middle protection. Other than the reduced security setting,
+    // behaves identically to the chrome.bluetoothSocket.connect() function.
+    // |socketId|: The socket identifier, as issued by the
+    //     chrome.bluetoothSocket API.
+    // |deviceAddress|: The Bluetooth address of the device to connect to.
+    // |uuid|: The UUID of the service to connect to.
+    // |callback|: Called when the connect attempt is complete.
+    static void connectToBluetoothServiceInsecurely(long socketId,
+                                                    DOMString deviceAddress,
+                                                    DOMString uuid,
+                                                    EmptyCallback callback);
+
     // Updates the screenlock state to reflect the Easy Unlock app state.
     static void updateScreenlockState(State state,
                                       optional EmptyCallback callback);
 
     // Gets the remote device list.
     static void getRemoteDevices(GetRemoteDevicesCallback callback);
+
+    // Gets the sign-in challenge for the current user.
+    static void getSignInChallenge(DataCallback callback);
+
+    // Tries to sign-in the current user with a secret obtained by decrypting
+    // the sign-in challenge. Check chrome.runtime.lastError for failures. Upon
+    // success, the user session will be started.
+    static void trySignInSecret(ArrayBuffer signInSecret,
+                                EmptyCallback callback);
+
+    // Retrieves information about the user associated with the Easy unlock
+    // service.
+    static void getUserInfo(GetUserInfoCallback callback);
+
+    // Gets the user's profile image as a bitmap.
+    static void getUserImage(DataCallback callback);
+  };
+
+  interface Events {
+    // Event fired when the data for the user currently associated with
+    // Easy unlock service is updated.
+    // |userInfo| The updated user information.
+    static void onUserInfoUpdated(UserInfo userInfo);
   };
 };