| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 * Class that wraps low-level details of interacting with the client plugin. | 7 * Class that wraps low-level details of interacting with the client plugin. |
| 8 * | 8 * |
| 9 * This abstracts a <embed> element and controls the plugin which does | 9 * This abstracts a <embed> element and controls the plugin which does |
| 10 * the actual remoting work. It also handles differences between | 10 * the actual remoting work. It also handles differences between |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 } else if (message.method == 'onConnectionReady') { | 243 } else if (message.method == 'onConnectionReady') { |
| 244 var ready = base.getBooleanAttr(message.data, 'ready'); | 244 var ready = base.getBooleanAttr(message.data, 'ready'); |
| 245 handler.onConnectionReady(ready); | 245 handler.onConnectionReady(ready); |
| 246 | 246 |
| 247 } else if (message.method == 'setCapabilities') { | 247 } else if (message.method == 'setCapabilities') { |
| 248 /** @type {!Array<string>} */ | 248 /** @type {!Array<string>} */ |
| 249 var capabilities = tokenize( | 249 var capabilities = tokenize( |
| 250 base.getStringAttr(message.data, 'capabilities')); | 250 base.getStringAttr(message.data, 'capabilities')); |
| 251 handler.onSetCapabilities(capabilities); | 251 handler.onSetCapabilities(capabilities); |
| 252 | 252 |
| 253 } else if (message.method == 'onFirstFrameReceived') { |
| 254 handler.onFirstFrameReceived(); |
| 255 |
| 253 } | 256 } |
| 254 } | 257 } |
| 255 | 258 |
| 256 if (message.method == 'hello') { | 259 if (message.method == 'hello') { |
| 257 // Resize in case we had to enlarge it to support click-to-play. | 260 // Resize in case we had to enlarge it to support click-to-play. |
| 258 this.hidePluginForClickToPlay_(); | 261 this.hidePluginForClickToPlay_(); |
| 259 this.pluginApiVersion_ = base.getNumberAttr(message.data, 'apiVersion'); | 262 this.pluginApiVersion_ = base.getNumberAttr(message.data, 'apiVersion'); |
| 260 this.pluginApiMinVersion_ = | 263 this.pluginApiMinVersion_ = |
| 261 base.getNumberAttr(message.data, 'apiMinVersion'); | 264 base.getNumberAttr(message.data, 'apiMinVersion'); |
| 262 | 265 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 base.getNumberAttr(message.data, 'renderLatency'); | 307 base.getNumberAttr(message.data, 'renderLatency'); |
| 305 base.getNumberAttr(message.data, 'roundtripLatency'); | 308 base.getNumberAttr(message.data, 'roundtripLatency'); |
| 306 this.perfStats_ = | 309 this.perfStats_ = |
| 307 /** @type {remoting.ClientSession.PerfStats} */ (message.data); | 310 /** @type {remoting.ClientSession.PerfStats} */ (message.data); |
| 308 | 311 |
| 309 } else if (message.method == 'injectClipboardItem') { | 312 } else if (message.method == 'injectClipboardItem') { |
| 310 var mimetype = base.getStringAttr(message.data, 'mimeType'); | 313 var mimetype = base.getStringAttr(message.data, 'mimeType'); |
| 311 var item = base.getStringAttr(message.data, 'item'); | 314 var item = base.getStringAttr(message.data, 'item'); |
| 312 this.updateClipboardData_(mimetype, item); | 315 this.updateClipboardData_(mimetype, item); |
| 313 | 316 |
| 314 } else if (message.method == 'onFirstFrameReceived') { | |
| 315 if (remoting.clientSession) { | |
| 316 remoting.clientSession.onFirstFrameReceived(); | |
| 317 } | |
| 318 | |
| 319 } else if (message.method == 'fetchPin') { | 317 } else if (message.method == 'fetchPin') { |
| 320 // The pairingSupported value in the dictionary indicates whether both | 318 // The pairingSupported value in the dictionary indicates whether both |
| 321 // client and host support pairing. If the client doesn't support pairing, | 319 // client and host support pairing. If the client doesn't support pairing, |
| 322 // then the value won't be there at all, so give it a default of false. | 320 // then the value won't be there at all, so give it a default of false. |
| 323 var pairingSupported = base.getBooleanAttr(message.data, 'pairingSupported', | 321 var pairingSupported = base.getBooleanAttr(message.data, 'pairingSupported', |
| 324 false); | 322 false); |
| 325 this.credentials_.getPIN(pairingSupported).then( | 323 this.credentials_.getPIN(pairingSupported).then( |
| 326 this.onPinFetched_.bind(this) | 324 this.onPinFetched_.bind(this) |
| 327 ); | 325 ); |
| 328 | 326 |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 remoting.DefaultClientPluginFactory.prototype.preloadPlugin = function() { | 869 remoting.DefaultClientPluginFactory.prototype.preloadPlugin = function() { |
| 872 if (remoting.settings.CLIENT_PLUGIN_TYPE != 'pnacl') { | 870 if (remoting.settings.CLIENT_PLUGIN_TYPE != 'pnacl') { |
| 873 return; | 871 return; |
| 874 } | 872 } |
| 875 | 873 |
| 876 var plugin = remoting.ClientPluginImpl.createPluginElement_(); | 874 var plugin = remoting.ClientPluginImpl.createPluginElement_(); |
| 877 plugin.addEventListener( | 875 plugin.addEventListener( |
| 878 'loadend', function() { document.body.removeChild(plugin); }, false); | 876 'loadend', function() { document.body.removeChild(plugin); }, false); |
| 879 document.body.appendChild(plugin); | 877 document.body.appendChild(plugin); |
| 880 }; | 878 }; |
| OLD | NEW |