Chromium Code Reviews| Index: chrome/common/extensions/api/gcd_private.idl |
| diff --git a/chrome/common/extensions/api/gcd_private.idl b/chrome/common/extensions/api/gcd_private.idl |
| index 2f975fd8e84224ea724b754b125682fd8f814cd8..dd5c0c8a6b3790498d6cbbd1291fb52bdb6681d4 100644 |
| --- a/chrome/common/extensions/api/gcd_private.idl |
| +++ b/chrome/common/extensions/api/gcd_private.idl |
| @@ -30,6 +30,9 @@ namespace gcdPrivate { |
| }; |
| enum Status { |
| + // Success. |
| + success, |
| + |
| // populateWifiPassword was true and the password has not been prefetched. |
| wifiPasswordError, |
| @@ -46,25 +49,16 @@ namespace gcdPrivate { |
| // Unknown session. |
| unknownSessionError, |
| - // Bad confirmation code. Ask user to retype. |
| - badConfirmationCodeError, |
| - |
| - // Success. |
| - success |
| - }; |
| + // Bad pairing code. Ask user to retype. |
| + badPairingCodeError, |
| - enum ConfirmationType { |
| - displayCode, |
| - stickerCode |
| + // Setup error. |
| + setupError |
| }; |
| - // Information regarding the confirmation of a device. |
| - dictionary ConfirmationInfo { |
|
mednik
2014/11/04 02:47:46
Why did this go away? How will the app know which
Vitaly Buka (NO REVIEWS)
2014/11/04 20:19:05
Now app choose which one to use.
|
| - // Type of confirmation. |
| - ConfirmationType type; |
| - |
| - // Code if available. |
| - DOMString? code; |
| + enum PairingType { |
| + pinCode, |
| + embeddedCode |
| }; |
| callback CloudDeviceListCallback = void(GCDDevice[] devices); |
| @@ -84,23 +78,23 @@ namespace gcdPrivate { |
| // TODO(vitalybuka): consider to describe object in IDL. |
| callback CommandListCallback = void(object[] commands); |
| - // Called when the confirmation code is available or on error. |
| - // |sessionId| is the session ID (identifies the session for future calls) |
| - // |status| is the status (success or type of error) |
| - // |confirmation| is the information about the confirmation. |
| - callback ConfirmationCodeCallback = void(long sessionId, |
| - Status status, |
| - ConfirmationInfo confirmation); |
| + // Generic callback for session calls, with status only. |
| + callback SessionCallback = void(Status status); |
| - // Called to indicated the session is established. |
| - // |status| is the status (success or type of error) |
| - callback SessionEstablishedCallback = void(Status status); |
| + // Called when device starts to establish a secure session. |
| + // If |status| is |success| app should vall |startPairing|. |
|
mednik
2014/11/04 02:47:46
Nit: typo "vall" -> "call".
Vitaly Buka (NO REVIEWS)
2014/11/04 20:19:05
Done.
|
| + // |sessionId| is the session ID (identifies the session for future calls). |
| + // |status| is the status (success or type of error). |
| + // |pairingTypes| is the list of supported pairing types. |
| + callback EstablishSessionCallback = void(long sessionId, |
| + Status status, |
| + PairingType[] pairingTypes); |
|
mednik
2014/11/04 02:47:46
Why do we need a list of pairing types? Can someth
Vitaly Buka (NO REVIEWS)
2014/11/04 20:19:05
Yes, if device support several types, we would try
|
| // Called when the response to the message sent is available or on error. |
| // |status| is the status (success or type of error) |
| // |response| is the response object or null on error |
| - callback MessageResponseCallback = void(Status status, |
| - object response); |
| + callback SendMessageCallback = void(Status status, |
| + object response); |
| // Called as a response to |prefetchWifiPassword| |
| // |success| Denotes whether the password fetch has succeeded or failed. |
| @@ -132,14 +126,20 @@ namespace gcdPrivate { |
| // Establish the session. |
| static void establishSession(DOMString ipAddress, |
| long port, |
| - ConfirmationCodeCallback callback); |
| + EstablishSessionCallback callback); |
| + |
| + // Start pairing with selected method. |
| + // |pairingType| is the any value provided |
|
mednik
2014/11/04 02:47:46
Nit: Missing ending period. Also typo "is the any"
Vitaly Buka (NO REVIEWS)
2014/11/04 20:19:05
Done.
|
| + static void startPairing(long sessionId, |
|
mednik
2014/11/04 02:47:46
When should this get called? How does this relate
Vitaly Buka (NO REVIEWS)
2014/11/04 20:19:05
Done.
|
| + PairingType pairingType, |
| + SessionCallback callback); |
| - // Send confirmation code. Device will still need to confirm. |code| must be |
| - // present and must match the code from the device, even when the code is |
| - // supplied in the |ConfirmationInfo| object. |
| + // Confirm pairing code. |
| + // |code| is the string generated by pairing process and availible to the |
| + // user. |
| static void confirmCode(long sessionId, |
| DOMString code, |
| - SessionEstablishedCallback callback); |
| + SessionCallback callback); |
| // Send an encrypted message to the device. |api| is the API path and |
| // |input| is the input object. If the message is a setup message with a |
| @@ -149,7 +149,7 @@ namespace gcdPrivate { |
| static void sendMessage(long sessionId, |
| DOMString api, |
| object input, |
| - MessageResponseCallback callback); |
| + SendMessageCallback callback); |
| // Terminate the session with the device. |
| static void terminateSession(long sessionId); |