Chromium Code Reviews| Index: remoting/webapp/crd/js/session_connector.js |
| diff --git a/remoting/webapp/crd/js/session_connector.js b/remoting/webapp/crd/js/session_connector.js |
| index 029e44f33f6a950f0e365deb31d586b43a54c3ef..a8ae938073fe75d239086afd95e5ea904f3e7621 100644 |
| --- a/remoting/webapp/crd/js/session_connector.js |
| +++ b/remoting/webapp/crd/js/session_connector.js |
| @@ -118,7 +118,7 @@ remoting.SessionConnectorFactory = function() {}; |
| /** |
| * @param {HTMLElement} clientContainer Container element for the client view. |
| - * @param {function(remoting.ClientSession):void} onConnected Callback on |
| + * @param {function(remoting.ConnectionInfo):void} onConnected Callback on |
| * success. |
| * @param {function(!remoting.Error):void} onError Callback on error. |
| * @param {function(string, string):boolean} appProtocolExtensionHandler The |
| @@ -140,3 +140,46 @@ remoting.SessionConnectorFactory.prototype.createConnector = |
| * @type {remoting.SessionConnectorFactory} |
| */ |
| remoting.SessionConnector.factory = null; |
| + |
| +/** |
| + * A struct that encapsulates the states of a remoting connection. It does not |
| + * manage the lifetime of its constituents. |
| + * |
| + * @param {remoting.Host} host |
| + * @param {remoting.CredentialsProvider} credentialsProvider |
| + * @param {remoting.ClientSession} session |
| + * @param {remoting.ClientPlugin} plugin |
| + * |
| + * @constructor |
| + * @struct |
| + */ |
| +remoting.ConnectionInfo = function(host, credentialsProvider, session, plugin) { |
|
garykac
2015/03/16 20:43:33
I think that this would be better in a separate fi
kelvinp
2015/03/16 21:00:21
Done.
|
| + /** @private */ |
| + this.host_ = host; |
| + /** @private */ |
| + this.credentialsProvider_ = credentialsProvider; |
| + /** @private */ |
| + this.session_ = session; |
| + /** @private */ |
| + this.plugin_ = plugin; |
| +}; |
| + |
| +/** @returns {remoting.Host} */ |
| +remoting.ConnectionInfo.prototype.host = function() { |
| + return this.host_; |
| +}; |
| + |
| +/** @returns {remoting.CredentialsProvider} */ |
| +remoting.ConnectionInfo.prototype.credentialsProvider = function() { |
| + return this.credentialsProvider_; |
| +}; |
| + |
| +/** @returns {remoting.ClientSession} */ |
| +remoting.ConnectionInfo.prototype.session = function() { |
| + return this.session_; |
| +}; |
| + |
| +/** @returns {remoting.ClientPlugin} */ |
| +remoting.ConnectionInfo.prototype.plugin = function() { |
| + return this.plugin_; |
| +}; |