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 handling creation and teardown of a remoting client session. | 7 * Class handling creation and teardown of a remoting client session. |
8 * | 8 * |
9 * The ClientSession class controls lifetime of the client plugin | 9 * The ClientSession class controls lifetime of the client plugin |
10 * object and provides the plugin with the functionality it needs to | 10 * object and provides the plugin with the functionality it needs to |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 * false otherwise. | 343 * false otherwise. |
344 * @return {remoting.ClientPlugin} Create plugin object for the locally | 344 * @return {remoting.ClientPlugin} Create plugin object for the locally |
345 * installed plugin. | 345 * installed plugin. |
346 */ | 346 */ |
347 remoting.ClientSession.prototype.createClientPlugin_ = | 347 remoting.ClientSession.prototype.createClientPlugin_ = |
348 function(container, id, onExtensionMessage) { | 348 function(container, id, onExtensionMessage) { |
349 var plugin = /** @type {remoting.ViewerPlugin} */ | 349 var plugin = /** @type {remoting.ViewerPlugin} */ |
350 document.createElement('embed'); | 350 document.createElement('embed'); |
351 | 351 |
352 plugin.id = id; | 352 plugin.id = id; |
353 plugin.src = 'about://none'; | 353 if (remoting.settings.CLIENT_PLUGIN_TYPE == 'pnacl') { |
354 plugin.type = 'application/vnd.chromium.remoting-viewer'; | 354 plugin.src = 'remoting_client_pnacl.nmf'; |
| 355 plugin.type = 'application/x-pnacl'; |
| 356 } else if (remoting.settings.CLIENT_PLUGIN_TYPE == 'nacl') { |
| 357 plugin.src = 'remoting_client_nacl.nmf'; |
| 358 plugin.type = 'application/x-nacl'; |
| 359 } else { |
| 360 plugin.src = 'about://none'; |
| 361 plugin.type = 'application/vnd.chromium.remoting-viewer'; |
| 362 } |
| 363 |
355 plugin.width = 0; | 364 plugin.width = 0; |
356 plugin.height = 0; | 365 plugin.height = 0; |
357 plugin.tabIndex = 0; // Required, otherwise focus() doesn't work. | 366 plugin.tabIndex = 0; // Required, otherwise focus() doesn't work. |
358 container.appendChild(plugin); | 367 container.appendChild(plugin); |
359 | 368 |
360 return new remoting.ClientPlugin(plugin, onExtensionMessage); | 369 return new remoting.ClientPlugin(plugin, onExtensionMessage); |
361 }; | 370 }; |
362 | 371 |
363 /** | 372 /** |
364 * Callback function called when the plugin element gets focus. | 373 * Callback function called when the plugin element gets focus. |
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1431 * supported. | 1440 * supported. |
1432 * @private | 1441 * @private |
1433 */ | 1442 */ |
1434 remoting.ClientSession.prototype.createGnubbyAuthHandler_ = function() { | 1443 remoting.ClientSession.prototype.createGnubbyAuthHandler_ = function() { |
1435 if (this.mode_ == remoting.ClientSession.Mode.ME2ME) { | 1444 if (this.mode_ == remoting.ClientSession.Mode.ME2ME) { |
1436 this.gnubbyAuthHandler_ = new remoting.GnubbyAuthHandler(this); | 1445 this.gnubbyAuthHandler_ = new remoting.GnubbyAuthHandler(this); |
1437 // TODO(psj): Move to more generic capabilities mechanism. | 1446 // TODO(psj): Move to more generic capabilities mechanism. |
1438 this.sendGnubbyAuthMessage({'type': 'control', 'option': 'auth-v1'}); | 1447 this.sendGnubbyAuthMessage({'type': 'control', 'option': 'auth-v1'}); |
1439 } | 1448 } |
1440 }; | 1449 }; |
OLD | NEW |