Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * Interface abstracting the SessionConnector functionality. | 7 * Interface abstracting the SessionConnector functionality. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 'use strict'; | 10 'use strict'; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 function(extension) {}; | 111 function(extension) {}; |
| 112 | 112 |
| 113 | 113 |
| 114 /** | 114 /** |
| 115 * @interface | 115 * @interface |
| 116 */ | 116 */ |
| 117 remoting.SessionConnectorFactory = function() {}; | 117 remoting.SessionConnectorFactory = function() {}; |
| 118 | 118 |
| 119 /** | 119 /** |
| 120 * @param {HTMLElement} clientContainer Container element for the client view. | 120 * @param {HTMLElement} clientContainer Container element for the client view. |
| 121 * @param {function(remoting.ClientSession):void} onConnected Callback on | 121 * @param {function(remoting.ConnectionInfo):void} onConnected Callback on |
| 122 * success. | 122 * success. |
| 123 * @param {function(!remoting.Error):void} onError Callback on error. | 123 * @param {function(!remoting.Error):void} onError Callback on error. |
| 124 * @param {function(string, string):boolean} appProtocolExtensionHandler The | 124 * @param {function(string, string):boolean} appProtocolExtensionHandler The |
| 125 * handler for the application's protocol extension messages. Returns true | 125 * handler for the application's protocol extension messages. Returns true |
| 126 * if a message is recognized; false otherwise. | 126 * if a message is recognized; false otherwise. |
| 127 * @param {function(!remoting.Error):void} onConnectionFailed Callback for when | 127 * @param {function(!remoting.Error):void} onConnectionFailed Callback for when |
| 128 * the connection fails. | 128 * the connection fails. |
| 129 * @param {Array<string>} requiredCapabilities Connector capabilities | 129 * @param {Array<string>} requiredCapabilities Connector capabilities |
| 130 * required by this application. | 130 * required by this application. |
| 131 * @param {string} defaultRemapKeys The default set of key mappings to use | 131 * @param {string} defaultRemapKeys The default set of key mappings to use |
| 132 * in the client session. | 132 * in the client session. |
| 133 * @return {remoting.SessionConnector} | 133 * @return {remoting.SessionConnector} |
| 134 */ | 134 */ |
| 135 remoting.SessionConnectorFactory.prototype.createConnector = | 135 remoting.SessionConnectorFactory.prototype.createConnector = |
| 136 function(clientContainer, onConnected, onError, appProtocolExtensionHandler, | 136 function(clientContainer, onConnected, onError, appProtocolExtensionHandler, |
| 137 onConnectionFailed, requiredCapabilities, defaultRemapKeys) {}; | 137 onConnectionFailed, requiredCapabilities, defaultRemapKeys) {}; |
| 138 | 138 |
| 139 /** | 139 /** |
| 140 * @type {remoting.SessionConnectorFactory} | 140 * @type {remoting.SessionConnectorFactory} |
| 141 */ | 141 */ |
| 142 remoting.SessionConnector.factory = null; | 142 remoting.SessionConnector.factory = null; |
| 143 | |
| 144 /** | |
| 145 * A struct that encapsulates the states of a remoting connection. It does not | |
| 146 * manage the lifetime of its constituents. | |
| 147 * | |
| 148 * @param {remoting.Host} host | |
| 149 * @param {remoting.CredentialsProvider} credentialsProvider | |
| 150 * @param {remoting.ClientSession} session | |
| 151 * @param {remoting.ClientPlugin} plugin | |
| 152 * | |
| 153 * @constructor | |
| 154 * @struct | |
| 155 */ | |
| 156 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.
| |
| 157 /** @private */ | |
| 158 this.host_ = host; | |
| 159 /** @private */ | |
| 160 this.credentialsProvider_ = credentialsProvider; | |
| 161 /** @private */ | |
| 162 this.session_ = session; | |
| 163 /** @private */ | |
| 164 this.plugin_ = plugin; | |
| 165 }; | |
| 166 | |
| 167 /** @returns {remoting.Host} */ | |
| 168 remoting.ConnectionInfo.prototype.host = function() { | |
| 169 return this.host_; | |
| 170 }; | |
| 171 | |
| 172 /** @returns {remoting.CredentialsProvider} */ | |
| 173 remoting.ConnectionInfo.prototype.credentialsProvider = function() { | |
| 174 return this.credentialsProvider_; | |
| 175 }; | |
| 176 | |
| 177 /** @returns {remoting.ClientSession} */ | |
| 178 remoting.ConnectionInfo.prototype.session = function() { | |
| 179 return this.session_; | |
| 180 }; | |
| 181 | |
| 182 /** @returns {remoting.ClientPlugin} */ | |
| 183 remoting.ConnectionInfo.prototype.plugin = function() { | |
| 184 return this.plugin_; | |
| 185 }; | |
| OLD | NEW |