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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 * false otherwise. | 356 * false otherwise. |
357 * @return {remoting.ClientPlugin} Create plugin object for the locally | 357 * @return {remoting.ClientPlugin} Create plugin object for the locally |
358 * installed plugin. | 358 * installed plugin. |
359 */ | 359 */ |
360 remoting.ClientSession.prototype.createClientPlugin_ = | 360 remoting.ClientSession.prototype.createClientPlugin_ = |
361 function(container, id, onExtensionMessage) { | 361 function(container, id, onExtensionMessage) { |
362 var plugin = /** @type {remoting.ViewerPlugin} */ | 362 var plugin = /** @type {remoting.ViewerPlugin} */ |
363 document.createElement('embed'); | 363 document.createElement('embed'); |
364 | 364 |
365 plugin.id = id; | 365 plugin.id = id; |
366 if (remoting.settings.CLIENT_PLUGIN_TYPE == 'pnacl') { | 366 plugin.src = 'about://none'; |
367 plugin.src = 'remoting_client_pnacl.nmf'; | 367 plugin.type = 'application/vnd.chromium.remoting-viewer'; |
368 plugin.type = 'application/x-pnacl'; | |
369 } else if (remoting.settings.CLIENT_PLUGIN_TYPE == 'nacl') { | |
370 plugin.src = 'remoting_client_nacl.nmf'; | |
371 plugin.type = 'application/x-nacl'; | |
372 } else { | |
373 plugin.src = 'about://none'; | |
374 plugin.type = 'application/vnd.chromium.remoting-viewer'; | |
375 } | |
376 | |
377 plugin.width = 0; | 368 plugin.width = 0; |
378 plugin.height = 0; | 369 plugin.height = 0; |
379 plugin.tabIndex = 0; // Required, otherwise focus() doesn't work. | 370 plugin.tabIndex = 0; // Required, otherwise focus() doesn't work. |
380 container.appendChild(plugin); | 371 container.appendChild(plugin); |
381 | 372 |
382 return new remoting.ClientPlugin(plugin, onExtensionMessage); | 373 return new remoting.ClientPlugin(plugin, onExtensionMessage); |
383 }; | 374 }; |
384 | 375 |
385 /** | 376 /** |
386 * Callback function called when the plugin element gets focus. | 377 * Callback function called when the plugin element gets focus. |
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1502 /** | 1493 /** |
1503 * @return {{width: number, height: number}} The height of the window's client | 1494 * @return {{width: number, height: number}} The height of the window's client |
1504 * area. This differs between apps v1 and apps v2 due to the custom window | 1495 * area. This differs between apps v1 and apps v2 due to the custom window |
1505 * borders used by the latter. | 1496 * borders used by the latter. |
1506 * @private | 1497 * @private |
1507 */ | 1498 */ |
1508 remoting.ClientSession.prototype.getClientArea_ = function() { | 1499 remoting.ClientSession.prototype.getClientArea_ = function() { |
1509 return remoting.windowFrame ? | 1500 return remoting.windowFrame ? |
1510 remoting.windowFrame.getClientArea() : | 1501 remoting.windowFrame.getClientArea() : |
1511 { 'width': window.innerWidth, 'height': window.innerHeight }; | 1502 { 'width': window.innerWidth, 'height': window.innerHeight }; |
1512 } | 1503 } |
OLD | NEW |