Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2738)

Unified Diff: chrome/common/extensions/api/gcd_private.idl

Issue 695253002: chrome.gcdPrivate allows app to choose pairing method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mon Nov 3 15:09:22 PST 2014 Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..5e402edcd4a7ab2202648201dbbe12b63233181c 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 {
- // 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 establishing of secure session is started.
Aleksey Shlyapnikov 2014/11/03 23:35:09 Called when device starts to establish a secure se
Vitaly Buka (NO REVIEWS) 2014/11/04 00:54:38 Done.
+ // If |status| is |success| app should vall |startPairing|.
+ // |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);
// 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
+ static void startPairing(long sessionId,
+ 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);

Powered by Google App Engine
This is Rietveld 408576698