Update V8 to version 3.30.4 (based on bleeding_edge revision r24443)
[chromium-blink-merge.git] / remoting / webapp / session_connector.js
blobdfdcda6eb1eac0cf40003cb5f268a921b43610e9
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.
5 /**
6 * @fileoverview
7 * Interface abstracting the SessionConnector functionality.
8 */
10 'use strict';
12 /** @suppress {duplicate} */
13 var remoting = remoting || {};
15 /**
16 * @interface
18 remoting.SessionConnector = function() {};
20 /**
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() {};
26 /**
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) {};
46 /**
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) {};
55 /**
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) {};
64 /**
65 * Reconnect a closed connection.
67 * @return {void} Nothing.
69 remoting.SessionConnector.prototype.reconnect = function() {};
71 /**
72 * Cancel a connection-in-progress.
74 remoting.SessionConnector.prototype.cancel = function() {};
76 /**
77 * Get the connection mode (Me2Me or IT2Me)
79 * @return {remoting.ClientSession.Mode}
81 remoting.SessionConnector.prototype.getConnectionMode = function() {};
83 /**
84 * Get host ID.
86 * @return {string}
88 remoting.SessionConnector.prototype.getHostId = function() {};
91 /**
92 * @interface
94 remoting.SessionConnectorFactory = function() {};
96 /**
97 * @param {HTMLElement} clientContainer Container element for the client view.
98 * @param {function(remoting.ClientSession):void} onConnected Callback on
99 * success.
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;
103 * false otherwise.
104 * @return {remoting.SessionConnector}
106 remoting.SessionConnectorFactory.prototype.createConnector =
107 function(clientContainer, onConnected, onError, onExtensionMessage) {};
110 * @type {remoting.SessionConnectorFactory}
112 remoting.SessionConnector.factory = null;