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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 * @param {remoting.CredentialsProvider} credentialsProvider | 574 * @param {remoting.CredentialsProvider} credentialsProvider |
575 */ | 575 */ |
576 remoting.ClientPluginImpl.prototype.connect = | 576 remoting.ClientPluginImpl.prototype.connect = |
577 function(host, localJid, credentialsProvider) { | 577 function(host, localJid, credentialsProvider) { |
578 var keyFilter = ''; | 578 var keyFilter = ''; |
579 if (remoting.platformIsMac()) { | 579 if (remoting.platformIsMac()) { |
580 keyFilter = 'mac'; | 580 keyFilter = 'mac'; |
581 } else if (remoting.platformIsChromeOS()) { | 581 } else if (remoting.platformIsChromeOS()) { |
582 keyFilter = 'cros'; | 582 keyFilter = 'cros'; |
583 } | 583 } |
584 // Use PPB_VideoDecoder API only in Chrome 42 and above. It is broken in | 584 |
585 // previous versions of Chrome, see http://crbug.com/447403 . | 585 // Use PPB_VideoDecoder API only in Chrome 43 and above. It is broken in |
586 // Currently PPAPI doesn't provide a way for plugins to check the Chrome | 586 // previous versions of Chrome, see crbug.com/459103 and crbug.com/463577 . |
587 // version, so this check needs to be in the webapp. | |
588 var enableVideoDecodeRenderer = | 587 var enableVideoDecodeRenderer = |
589 parseInt((remoting.getChromeVersion() || '0').split('.')[0], 10) >= 42; | 588 parseInt((remoting.getChromeVersion() || '0').split('.')[0], 10) >= 43; |
590 this.plugin_.postMessage(JSON.stringify( | 589 this.plugin_.postMessage(JSON.stringify( |
591 { method: 'delegateLargeCursors', data: {} })); | 590 { method: 'delegateLargeCursors', data: {} })); |
592 var methods = 'third_party,spake2_pair,spake2_hmac,spake2_plain'; | 591 var methods = 'third_party,spake2_pair,spake2_hmac,spake2_plain'; |
593 this.credentials_ = credentialsProvider; | 592 this.credentials_ = credentialsProvider; |
594 this.useAsyncPinDialog_(); | 593 this.useAsyncPinDialog_(); |
595 this.plugin_.postMessage(JSON.stringify( | 594 this.plugin_.postMessage(JSON.stringify( |
596 { method: 'connect', data: { | 595 { method: 'connect', data: { |
597 hostJid: host.jabberId, | 596 hostJid: host.jabberId, |
598 hostPublicKey: host.publicKey, | 597 hostPublicKey: host.publicKey, |
599 localJid: localJid, | 598 localJid: localJid, |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
908 remoting.DefaultClientPluginFactory.prototype.preloadPlugin = function() { | 907 remoting.DefaultClientPluginFactory.prototype.preloadPlugin = function() { |
909 if (remoting.settings.CLIENT_PLUGIN_TYPE != 'pnacl') { | 908 if (remoting.settings.CLIENT_PLUGIN_TYPE != 'pnacl') { |
910 return; | 909 return; |
911 } | 910 } |
912 | 911 |
913 var plugin = remoting.ClientPluginImpl.createPluginElement_(); | 912 var plugin = remoting.ClientPluginImpl.createPluginElement_(); |
914 plugin.addEventListener( | 913 plugin.addEventListener( |
915 'loadend', function() { document.body.removeChild(plugin); }, false); | 914 'loadend', function() { document.body.removeChild(plugin); }, false); |
916 document.body.appendChild(plugin); | 915 document.body.appendChild(plugin); |
917 }; | 916 }; |
OLD | NEW |