Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: remoting/webapp/crd/js/client_plugin_impl.js

Issue 929323003: Separate host desktop related functionality into remoting.HostDesktop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewer's feedback Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 30 matching lines...) Expand all
41 this.plugin_.id = 'session-client-plugin'; 41 this.plugin_.id = 'session-client-plugin';
42 container.appendChild(this.plugin_); 42 container.appendChild(this.plugin_);
43 43
44 this.onExtensionMessage_ = onExtensionMessage; 44 this.onExtensionMessage_ = onExtensionMessage;
45 /** 45 /**
46 * @type {Array<string>} 46 * @type {Array<string>}
47 * @private 47 * @private
48 */ 48 */
49 this.requiredCapabilities_ = requiredCapabilities; 49 this.requiredCapabilities_ = requiredCapabilities;
50 50
51 /** @private */
52 this.desktopWidth_ = 0;
53 /** @private */
54 this.desktopHeight_ = 0;
55 /** @private */
56 this.desktopXDpi_ = 96;
57 /** @private */
58 this.desktopYDpi_ = 96;
59
60 /** 51 /**
61 * @param {string} iq The Iq stanza received from the host. 52 * @param {string} iq The Iq stanza received from the host.
62 * @private 53 * @private
63 */ 54 */
64 this.onOutgoingIqHandler_ = function (iq) {}; 55 this.onOutgoingIqHandler_ = function (iq) {};
65 /** 56 /**
66 * @param {string} message Log message. 57 * @param {string} message Log message.
67 * @private 58 * @private
68 */ 59 */
69 this.onDebugMessageHandler_ = function (message) {}; 60 this.onDebugMessageHandler_ = function (message) {};
(...skipping 18 matching lines...) Expand all
88 this.onConnectionReadyHandler_ = function(ready) {}; 79 this.onConnectionReadyHandler_ = function(ready) {};
89 80
90 /** 81 /**
91 * @param {string} tokenUrl Token-request URL, received from the host. 82 * @param {string} tokenUrl Token-request URL, received from the host.
92 * @param {string} hostPublicKey Public key for the host. 83 * @param {string} hostPublicKey Public key for the host.
93 * @param {string} scope OAuth scope to request the token for. 84 * @param {string} scope OAuth scope to request the token for.
94 * @private 85 * @private
95 */ 86 */
96 this.fetchThirdPartyTokenHandler_ = function( 87 this.fetchThirdPartyTokenHandler_ = function(
97 tokenUrl, hostPublicKey, scope) {}; 88 tokenUrl, hostPublicKey, scope) {};
98 /** @private */
99 this.onDesktopSizeUpdateHandler_ = function () {};
100 /**
101 * @param {Array<Array<number>>} rects
102 * @private
103 */
104 this.onDesktopShapeUpdateHandler_ = function (rects) {};
105 /** 89 /**
106 * @param {!Array<string>} capabilities The negotiated capabilities. 90 * @param {!Array<string>} capabilities The negotiated capabilities.
107 * @private 91 * @private
108 */ 92 */
109 this.onSetCapabilitiesHandler_ = function (capabilities) {}; 93 this.onSetCapabilitiesHandler_ = function (capabilities) {};
110 /** @private */ 94 /** @private */
111 this.fetchPinHandler_ = function (supportsPairing) {}; 95 this.fetchPinHandler_ = function (supportsPairing) {};
112 /** 96 /**
113 * @param {string} data Remote gnubbyd data. 97 * @param {string} data Remote gnubbyd data.
114 * @private 98 * @private
(...skipping 27 matching lines...) Expand all
142 * @type {number} 126 * @type {number}
143 * @private 127 * @private
144 */ 128 */
145 this.pluginApiMinVersion_ = -1; 129 this.pluginApiMinVersion_ = -1;
146 /** 130 /**
147 * @type {!Array<string>} 131 * @type {!Array<string>}
148 * @private 132 * @private
149 */ 133 */
150 this.capabilities_ = []; 134 this.capabilities_ = [];
151 /** 135 /**
136 * @type {!Array<string>}
137 * @private
138 */
139 this.hostCapabilities_ = [];
140 /**
152 * @type {boolean} 141 * @type {boolean}
153 * @private 142 * @private
154 */ 143 */
155 this.helloReceived_ = false; 144 this.helloReceived_ = false;
156 /** 145 /**
157 * @type {function(boolean)|null} 146 * @type {function(boolean)|null}
158 * @private 147 * @private
159 */ 148 */
160 this.onInitializedCallback_ = null; 149 this.onInitializedCallback_ = null;
161 /** 150 /**
(...skipping 11 matching lines...) Expand all
173 var that = this; 162 var that = this;
174 /** @param {Event} event Message event from the plugin. */ 163 /** @param {Event} event Message event from the plugin. */
175 this.plugin_.addEventListener('message', function(event) { 164 this.plugin_.addEventListener('message', function(event) {
176 that.handleMessage_( 165 that.handleMessage_(
177 /** @type {remoting.ClientPluginMessage} */ (event.data)); 166 /** @type {remoting.ClientPluginMessage} */ (event.data));
178 }, false); 167 }, false);
179 168
180 if (remoting.settings.CLIENT_PLUGIN_TYPE == 'native') { 169 if (remoting.settings.CLIENT_PLUGIN_TYPE == 'native') {
181 window.setTimeout(this.showPluginForClickToPlay_.bind(this), 500); 170 window.setTimeout(this.showPluginForClickToPlay_.bind(this), 500);
182 } 171 }
172
173 this.hostDesktop_ = new remoting.ClientPlugin.HostDesktopImpl(
174 this, this.postMessage_.bind(this));
183 }; 175 };
184 176
185 /** 177 /**
186 * Creates plugin element without adding it to a container. 178 * Creates plugin element without adding it to a container.
187 * 179 *
188 * @return {HTMLEmbedElement} Plugin element 180 * @return {HTMLEmbedElement} Plugin element
189 */ 181 */
190 remoting.ClientPluginImpl.createPluginElement_ = function() { 182 remoting.ClientPluginImpl.createPluginElement_ = function() {
191 var plugin = 183 var plugin =
192 /** @type {HTMLEmbedElement} */ (document.createElement('embed')); 184 /** @type {HTMLEmbedElement} */ (document.createElement('embed'));
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 250
259 /** 251 /**
260 * @param {function(boolean):void} handler 252 * @param {function(boolean):void} handler
261 */ 253 */
262 remoting.ClientPluginImpl.prototype.setConnectionReadyHandler = 254 remoting.ClientPluginImpl.prototype.setConnectionReadyHandler =
263 function(handler) { 255 function(handler) {
264 this.onConnectionReadyHandler_ = handler; 256 this.onConnectionReadyHandler_ = handler;
265 }; 257 };
266 258
267 /** 259 /**
268 * @param {function():void} handler
269 */
270 remoting.ClientPluginImpl.prototype.setDesktopSizeUpdateHandler =
271 function(handler) {
272 this.onDesktopSizeUpdateHandler_ = handler;
273 };
274
275 /**
276 * @param {function(Array<Array<number>>):void} handler
277 */
278 remoting.ClientPluginImpl.prototype.setDesktopShapeUpdateHandler =
279 function(handler) {
280 this.onDesktopShapeUpdateHandler_ = handler;
281 };
282
283 /**
284 * @param {function(!Array<string>):void} handler 260 * @param {function(!Array<string>):void} handler
285 */ 261 */
286 remoting.ClientPluginImpl.prototype.setCapabilitiesHandler = function(handler) { 262 remoting.ClientPluginImpl.prototype.setCapabilitiesHandler = function(handler) {
287 this.onSetCapabilitiesHandler_ = handler; 263 this.onSetCapabilitiesHandler_ = handler;
288 }; 264 };
289 265
290 /** 266 /**
291 * @param {function(string):void} handler 267 * @param {function(string):void} handler
292 */ 268 */
293 remoting.ClientPluginImpl.prototype.setGnubbyAuthHandler = function(handler) { 269 remoting.ClientPluginImpl.prototype.setGnubbyAuthHandler = function(handler) {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 // Resize in case we had to enlarge it to support click-to-play. 343 // Resize in case we had to enlarge it to support click-to-play.
368 this.hidePluginForClickToPlay_(); 344 this.hidePluginForClickToPlay_();
369 this.pluginApiVersion_ = getNumberAttr(message.data, 'apiVersion'); 345 this.pluginApiVersion_ = getNumberAttr(message.data, 'apiVersion');
370 this.pluginApiMinVersion_ = getNumberAttr(message.data, 'apiMinVersion'); 346 this.pluginApiMinVersion_ = getNumberAttr(message.data, 'apiMinVersion');
371 347
372 if (this.pluginApiVersion_ >= 7) { 348 if (this.pluginApiVersion_ >= 7) {
373 this.pluginApiFeatures_ = 349 this.pluginApiFeatures_ =
374 tokenize(getStringAttr(message.data, 'apiFeatures')); 350 tokenize(getStringAttr(message.data, 'apiFeatures'));
375 351
376 // Negotiate capabilities. 352 // Negotiate capabilities.
377
378 /** @type {!Array<string>} */
379 var requestedCapabilities = [];
380 if ('requestedCapabilities' in message.data) {
381 requestedCapabilities =
382 tokenize(getStringAttr(message.data, 'requestedCapabilities'));
383 }
384
385 /** @type {!Array<string>} */ 353 /** @type {!Array<string>} */
386 var supportedCapabilities = []; 354 var supportedCapabilities = [];
387 if ('supportedCapabilities' in message.data) { 355 if ('supportedCapabilities' in message.data) {
388 supportedCapabilities = 356 supportedCapabilities =
389 tokenize(getStringAttr(message.data, 'supportedCapabilities')); 357 tokenize(getStringAttr(message.data, 'supportedCapabilities'));
390 } 358 }
391 // At the moment the webapp does not recognize any of 359 // At the moment the webapp does not recognize any of
392 // 'requestedCapabilities' capabilities (so they all should be disabled) 360 // 'requestedCapabilities' capabilities (so they all should be disabled)
393 // and do not care about any of 'supportedCapabilities' capabilities (so 361 // and do not care about any of 'supportedCapabilities' capabilities (so
394 // they all can be enabled). 362 // they all can be enabled).
(...skipping 23 matching lines...) Expand all
418 var error = remoting.ClientSession.ConnectionError.fromString( 386 var error = remoting.ClientSession.ConnectionError.fromString(
419 getStringAttr(message.data, 'error')); 387 getStringAttr(message.data, 'error'));
420 this.onConnectionStatusUpdateHandler_(state, error); 388 this.onConnectionStatusUpdateHandler_(state, error);
421 389
422 } else if (message.method == 'onRouteChanged') { 390 } else if (message.method == 'onRouteChanged') {
423 var channel = getStringAttr(message.data, 'channel'); 391 var channel = getStringAttr(message.data, 'channel');
424 var connectionType = getStringAttr(message.data, 'connectionType'); 392 var connectionType = getStringAttr(message.data, 'connectionType');
425 this.onRouteChangedHandler_(channel, connectionType); 393 this.onRouteChangedHandler_(channel, connectionType);
426 394
427 } else if (message.method == 'onDesktopSize') { 395 } else if (message.method == 'onDesktopSize') {
428 this.desktopWidth_ = getNumberAttr(message.data, 'width'); 396 this.hostDesktop_.onSizeUpdated(message);
429 this.desktopHeight_ = getNumberAttr(message.data, 'height');
430 this.desktopXDpi_ = getNumberAttr(message.data, 'x_dpi', 96);
431 this.desktopYDpi_ = getNumberAttr(message.data, 'y_dpi', 96);
432 this.onDesktopSizeUpdateHandler_();
433
434 } else if (message.method == 'onDesktopShape') { 397 } else if (message.method == 'onDesktopShape') {
435 var rects = getArrayAttr(message.data, 'rects'); 398 this.hostDesktop_.onShapeUpdated(message);
436 for (var i = 0; i < rects.length; ++i) {
437 /** @type {Array<number>} */
438 var rect = rects[i];
439 if (typeof rect != 'object' || rect.length != 4) {
440 throw 'Received invalid onDesktopShape message';
441 }
442 }
443 this.onDesktopShapeUpdateHandler_(rects);
444
445 } else if (message.method == 'onPerfStats') { 399 } else if (message.method == 'onPerfStats') {
446 // Return value is ignored. These calls will throw an error if the value 400 // Return value is ignored. These calls will throw an error if the value
447 // is not a number. 401 // is not a number.
448 getNumberAttr(message.data, 'videoBandwidth'); 402 getNumberAttr(message.data, 'videoBandwidth');
449 getNumberAttr(message.data, 'videoFrameRate'); 403 getNumberAttr(message.data, 'videoFrameRate');
450 getNumberAttr(message.data, 'captureLatency'); 404 getNumberAttr(message.data, 'captureLatency');
451 getNumberAttr(message.data, 'encodeLatency'); 405 getNumberAttr(message.data, 'encodeLatency');
452 getNumberAttr(message.data, 'decodeLatency'); 406 getNumberAttr(message.data, 'decodeLatency');
453 getNumberAttr(message.data, 'renderLatency'); 407 getNumberAttr(message.data, 'renderLatency');
454 getNumberAttr(message.data, 'roundtripLatency'); 408 getNumberAttr(message.data, 'roundtripLatency');
(...skipping 20 matching lines...) Expand all
475 // The pairingSupported value in the dictionary indicates whether both 429 // The pairingSupported value in the dictionary indicates whether both
476 // client and host support pairing. If the client doesn't support pairing, 430 // client and host support pairing. If the client doesn't support pairing,
477 // then the value won't be there at all, so give it a default of false. 431 // then the value won't be there at all, so give it a default of false.
478 var pairingSupported = getBooleanAttr(message.data, 'pairingSupported', 432 var pairingSupported = getBooleanAttr(message.data, 'pairingSupported',
479 false) 433 false)
480 this.fetchPinHandler_(pairingSupported); 434 this.fetchPinHandler_(pairingSupported);
481 435
482 } else if (message.method == 'setCapabilities') { 436 } else if (message.method == 'setCapabilities') {
483 /** @type {!Array<string>} */ 437 /** @type {!Array<string>} */
484 var capabilities = tokenize(getStringAttr(message.data, 'capabilities')); 438 var capabilities = tokenize(getStringAttr(message.data, 'capabilities'));
439 this.hostDesktop_.onSetCapabilities(capabilities);
485 this.onSetCapabilitiesHandler_(capabilities); 440 this.onSetCapabilitiesHandler_(capabilities);
486 441
487 } else if (message.method == 'fetchThirdPartyToken') { 442 } else if (message.method == 'fetchThirdPartyToken') {
488 var tokenUrl = getStringAttr(message.data, 'tokenUrl'); 443 var tokenUrl = getStringAttr(message.data, 'tokenUrl');
489 var hostPublicKey = getStringAttr(message.data, 'hostPublicKey'); 444 var hostPublicKey = getStringAttr(message.data, 'hostPublicKey');
490 var scope = getStringAttr(message.data, 'scope'); 445 var scope = getStringAttr(message.data, 'scope');
491 this.fetchThirdPartyTokenHandler_(tokenUrl, hostPublicKey, scope); 446 this.fetchThirdPartyTokenHandler_(tokenUrl, hostPublicKey, scope);
492 447
493 } else if (message.method == 'pairingResponse') { 448 } else if (message.method == 'pairingResponse') {
494 var clientId = getStringAttr(message.data, 'clientId'); 449 var clientId = getStringAttr(message.data, 'clientId');
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 remoting.ClientPluginImpl.prototype.hasFeature = function(feature) { 549 remoting.ClientPluginImpl.prototype.hasFeature = function(feature) {
595 if (!this.helloReceived_) { 550 if (!this.helloReceived_) {
596 console.error( 551 console.error(
597 "hasFeature() is called before the plugin is initialized."); 552 "hasFeature() is called before the plugin is initialized.");
598 return false; 553 return false;
599 } 554 }
600 return this.pluginApiFeatures_.indexOf(feature) > -1; 555 return this.pluginApiFeatures_.indexOf(feature) > -1;
601 }; 556 };
602 557
603 /** 558 /**
559 * @param {string} capability The capability to test for.
560 * @return {boolean} True if the host supports the named capability.
561 */
562 remoting.ClientPluginImpl.prototype.hasCapability = function(capability) {
563 if (!this.hostCapabilities_) {
564 console.error(
565 "hasCapability() is called before the capabilities are received.");
566 return false;
567 }
568 return this.hostCapabilities_.indexOf(capability) > -1;
569 };
570
571 /**
604 * @return {boolean} True if the plugin supports the injectKeyEvent API. 572 * @return {boolean} True if the plugin supports the injectKeyEvent API.
605 */ 573 */
606 remoting.ClientPluginImpl.prototype.isInjectKeyEventSupported = function() { 574 remoting.ClientPluginImpl.prototype.isInjectKeyEventSupported = function() {
607 return this.pluginApiVersion_ >= 6; 575 return this.pluginApiVersion_ >= 6;
608 }; 576 };
609 577
610 /** 578 /**
611 * @param {string} iq Incoming IQ stanza. 579 * @param {string} iq Incoming IQ stanza.
612 */ 580 */
613 remoting.ClientPluginImpl.prototype.onIncomingIq = function(iq) { 581 remoting.ClientPluginImpl.prototype.onIncomingIq = function(iq) {
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 719
752 /** 720 /**
753 * Notifies the host that the client has the specified size and pixel density. 721 * Notifies the host that the client has the specified size and pixel density.
754 * 722 *
755 * @param {number} width The available client width in DIPs. 723 * @param {number} width The available client width in DIPs.
756 * @param {number} height The available client height in DIPs. 724 * @param {number} height The available client height in DIPs.
757 * @param {number} device_scale The number of device pixels per DIP. 725 * @param {number} device_scale The number of device pixels per DIP.
758 */ 726 */
759 remoting.ClientPluginImpl.prototype.notifyClientResolution = 727 remoting.ClientPluginImpl.prototype.notifyClientResolution =
760 function(width, height, device_scale) { 728 function(width, height, device_scale) {
761 if (this.hasFeature(remoting.ClientPlugin.Feature.NOTIFY_CLIENT_RESOLUTION)) { 729 this.hostDesktop_.resize(width, height, device_scale);
762 var dpi = Math.floor(device_scale * 96);
763 this.plugin_.postMessage(JSON.stringify(
764 { method: 'notifyClientResolution',
765 data: { width: Math.floor(width * device_scale),
766 height: Math.floor(height * device_scale),
767 x_dpi: dpi, y_dpi: dpi }}));
768 }
769 }; 730 };
770 731
771 /** 732 /**
772 * Requests that the host pause or resume sending video updates. 733 * Requests that the host pause or resume sending video updates.
773 * 734 *
774 * @param {boolean} pause True to suspend video updates, false otherwise. 735 * @param {boolean} pause True to suspend video updates, false otherwise.
775 */ 736 */
776 remoting.ClientPluginImpl.prototype.pauseVideo = 737 remoting.ClientPluginImpl.prototype.pauseVideo =
777 function(pause) { 738 function(pause) {
778 if (this.hasFeature(remoting.ClientPlugin.Feature.VIDEO_CONTROL)) { 739 if (this.hasFeature(remoting.ClientPlugin.Feature.VIDEO_CONTROL)) {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 function(type, message) { 861 function(type, message) {
901 if (!this.hasFeature(remoting.ClientPlugin.Feature.EXTENSION_MESSAGE)) { 862 if (!this.hasFeature(remoting.ClientPlugin.Feature.EXTENSION_MESSAGE)) {
902 return; 863 return;
903 } 864 }
904 this.plugin_.postMessage(JSON.stringify( 865 this.plugin_.postMessage(JSON.stringify(
905 { method: 'extensionMessage', 866 { method: 'extensionMessage',
906 data: { type: type, data: message } })); 867 data: { type: type, data: message } }));
907 868
908 }; 869 };
909 870
910 remoting.ClientPluginImpl.prototype.getDesktopWidth = function() { 871 remoting.ClientPluginImpl.prototype.hostDesktop = function() {
911 return this.desktopWidth_; 872 return this.hostDesktop_;
912 } 873 };
913
914 remoting.ClientPluginImpl.prototype.getDesktopHeight = function() {
915 return this.desktopHeight_;
916 }
917
918 remoting.ClientPluginImpl.prototype.getDesktopXDpi = function() {
919 return this.desktopXDpi_;
920 }
921
922 remoting.ClientPluginImpl.prototype.getDesktopYDpi = function() {
923 return this.desktopYDpi_;
924 }
925 874
926 /** 875 /**
927 * If we haven't yet received a "hello" message from the plugin, change its 876 * If we haven't yet received a "hello" message from the plugin, change its
928 * size so that the user can confirm it if click-to-play is enabled, or can 877 * size so that the user can confirm it if click-to-play is enabled, or can
929 * see the "this plugin is disabled" message if it is actually disabled. 878 * see the "this plugin is disabled" message if it is actually disabled.
930 * @private 879 * @private
931 */ 880 */
932 remoting.ClientPluginImpl.prototype.showPluginForClickToPlay_ = function() { 881 remoting.ClientPluginImpl.prototype.showPluginForClickToPlay_ = function() {
933 if (!this.helloReceived_) { 882 if (!this.helloReceived_) {
934 var width = 200; 883 var width = 200;
(...skipping 14 matching lines...) Expand all
949 * @private 898 * @private
950 */ 899 */
951 remoting.ClientPluginImpl.prototype.hidePluginForClickToPlay_ = function() { 900 remoting.ClientPluginImpl.prototype.hidePluginForClickToPlay_ = function() {
952 this.plugin_.style.width = ''; 901 this.plugin_.style.width = '';
953 this.plugin_.style.height = ''; 902 this.plugin_.style.height = '';
954 this.plugin_.style.top = ''; 903 this.plugin_.style.top = '';
955 this.plugin_.style.left = ''; 904 this.plugin_.style.left = '';
956 this.plugin_.style.position = ''; 905 this.plugin_.style.position = '';
957 }; 906 };
958 907
908 /**
909 * Callback passed to submodules to post a message to the plugin.
910 *
911 * @param {Object} objectLiteral
912 * @private
913 */
914 remoting.ClientPluginImpl.prototype.postMessage_ = function(objectLiteral) {
915 if (this.plugin_ && this.plugin_.postMessage) {
916 this.plugin_.postMessage(JSON.stringify(objectLiteral));
917 }
918 };
959 919
960 /** 920 /**
961 * @constructor 921 * @constructor
962 * @implements {remoting.ClientPluginFactory} 922 * @implements {remoting.ClientPluginFactory}
963 */ 923 */
964 remoting.DefaultClientPluginFactory = function() {}; 924 remoting.DefaultClientPluginFactory = function() {};
965 925
966 /** 926 /**
967 * @param {Element} container 927 * @param {Element} container
968 * @param {function(string, string):boolean} onExtensionMessage 928 * @param {function(string, string):boolean} onExtensionMessage
969 * @param {Array<string>} requiredCapabilities 929 * @param {Array<string>} requiredCapabilities
970 * @return {remoting.ClientPlugin} 930 * @return {remoting.ClientPlugin}
971 */ 931 */
972 remoting.DefaultClientPluginFactory.prototype.createPlugin = 932 remoting.DefaultClientPluginFactory.prototype.createPlugin =
973 function(container, onExtensionMessage, requiredCapabilities) { 933 function(container, onExtensionMessage, requiredCapabilities) {
974 return new remoting.ClientPluginImpl(container, onExtensionMessage, 934 return new remoting.ClientPluginImpl(container, onExtensionMessage,
975 requiredCapabilities); 935 requiredCapabilities);
976 }; 936 };
977 937
978 remoting.DefaultClientPluginFactory.prototype.preloadPlugin = function() { 938 remoting.DefaultClientPluginFactory.prototype.preloadPlugin = function() {
979 if (remoting.settings.CLIENT_PLUGIN_TYPE != 'pnacl') { 939 if (remoting.settings.CLIENT_PLUGIN_TYPE != 'pnacl') {
980 return; 940 return;
981 } 941 }
982 942
983 var plugin = remoting.ClientPluginImpl.createPluginElement_(); 943 var plugin = remoting.ClientPluginImpl.createPluginElement_();
984 plugin.addEventListener( 944 plugin.addEventListener(
985 'loadend', function() { document.body.removeChild(plugin); }, false); 945 'loadend', function() { document.body.removeChild(plugin); }, false);
986 document.body.appendChild(plugin); 946 document.body.appendChild(plugin);
987 }; 947 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698