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
3 // found in the LICENSE file.
7 * Interface abstracting the SessionConnector functionality.
12 /** @suppress {duplicate} */
13 var remoting
= remoting
|| {};
18 remoting
.SessionConnector = function() {};
21 * Reset the per-connection state so that the object can be re-used for a
22 * second connection. Note the none of the shared WCS state is reset.
24 remoting
.SessionConnector
.prototype.reset = function() {};
27 * Initiate a Me2Me connection.
29 * @param {remoting.Host} host The Me2Me host to which to connect.
30 * @param {function(boolean, function(string):void):void} fetchPin Function to
31 * interactively obtain the PIN from the user.
32 * @param {function(string, string, string,
33 * function(string, string): void): void}
34 * fetchThirdPartyToken Function to obtain a token from a third party
35 * authenticaiton server.
36 * @param {string} clientPairingId The client id issued by the host when
37 * this device was paired, if it is already paired.
38 * @param {string} clientPairedSecret The shared secret issued by the host when
39 * this device was paired, if it is already paired.
40 * @return {void} Nothing.
42 remoting
.SessionConnector
.prototype.connectMe2Me
=
43 function(host
, fetchPin
, fetchThirdPartyToken
,
44 clientPairingId
, clientPairedSecret
) {};
47 * Update the pairing info so that the reconnect function will work correctly.
49 * @param {string} clientId The paired client id.
50 * @param {string} sharedSecret The shared secret.
52 remoting
.SessionConnector
.prototype.updatePairingInfo
=
53 function(clientId
, sharedSecret
) {};
56 * Initiate an IT2Me connection.
58 * @param {string} accessCode The access code as entered by the user.
59 * @return {void} Nothing.
61 remoting
.SessionConnector
.prototype.connectIT2Me
=
62 function(accessCode
) {};
65 * Reconnect a closed connection.
67 * @return {void} Nothing.
69 remoting
.SessionConnector
.prototype.reconnect = function() {};
72 * Cancel a connection-in-progress.
74 remoting
.SessionConnector
.prototype.cancel = function() {};
77 * Get the connection mode (Me2Me or IT2Me)
79 * @return {remoting.ClientSession.Mode}
81 remoting
.SessionConnector
.prototype.getConnectionMode = function() {};
88 remoting
.SessionConnector
.prototype.getHostId = function() {};
94 remoting
.SessionConnectorFactory = function() {};
97 * @param {HTMLElement} clientContainer Container element for the client view.
98 * @param {function(remoting.ClientSession):void} onConnected Callback on
100 * @param {function(remoting.Error):void} onError Callback on error.
101 * @param {function(string, string):boolean} onExtensionMessage The handler for
102 * protocol extension messages. Returns true if a message is recognized;
104 * @return {remoting.SessionConnector}
106 remoting
.SessionConnectorFactory
.prototype.createConnector
=
107 function(clientContainer
, onConnected
, onError
, onExtensionMessage
) {};
110 * @type {remoting.SessionConnectorFactory}
112 remoting
.SessionConnector
.factory
= null;