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 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 /** | 543 /** |
544 * Sets and stores the key remapping setting for the current host. | 544 * Sets and stores the key remapping setting for the current host. |
545 * | 545 * |
546 * @param {!Object} remappings | 546 * @param {!Object} remappings |
547 */ | 547 */ |
548 remoting.ClientPluginImpl.prototype.setRemapKeys = | 548 remoting.ClientPluginImpl.prototype.setRemapKeys = |
549 function(remappings) { | 549 function(remappings) { |
550 // Cancel any existing remappings and apply the new ones. | 550 // Cancel any existing remappings and apply the new ones. |
551 this.applyRemapKeys_(this.keyRemappings_, false); | 551 this.applyRemapKeys_(this.keyRemappings_, false); |
552 this.applyRemapKeys_(remappings, true); | 552 this.applyRemapKeys_(remappings, true); |
553 this.keyRemappings_ = remappings; | 553 this.keyRemappings_ = /** @type {!Object} */ (base.deepCopy(remappings)); |
554 }; | 554 }; |
555 | 555 |
556 /** | 556 /** |
557 * Applies the configured key remappings to the session, or resets them. | 557 * Applies the configured key remappings to the session, or resets them. |
558 * | 558 * |
559 * @param {!Object} remappings | 559 * @param {!Object} remappings |
560 * @param {boolean} apply True to apply remappings, false to cancel them. | 560 * @param {boolean} apply True to apply remappings, false to cancel them. |
561 * @private | 561 * @private |
562 */ | 562 */ |
563 remoting.ClientPluginImpl.prototype.applyRemapKeys_ = | 563 remoting.ClientPluginImpl.prototype.applyRemapKeys_ = |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 remoting.DefaultClientPluginFactory.prototype.preloadPlugin = function() { | 887 remoting.DefaultClientPluginFactory.prototype.preloadPlugin = function() { |
888 if (remoting.settings.CLIENT_PLUGIN_TYPE != 'pnacl') { | 888 if (remoting.settings.CLIENT_PLUGIN_TYPE != 'pnacl') { |
889 return; | 889 return; |
890 } | 890 } |
891 | 891 |
892 var plugin = remoting.ClientPluginImpl.createPluginElement_(); | 892 var plugin = remoting.ClientPluginImpl.createPluginElement_(); |
893 plugin.addEventListener( | 893 plugin.addEventListener( |
894 'loadend', function() { document.body.removeChild(plugin); }, false); | 894 'loadend', function() { document.body.removeChild(plugin); }, false); |
895 document.body.appendChild(plugin); | 895 document.body.appendChild(plugin); |
896 }; | 896 }; |
OLD | NEW |