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 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 remoting.ClientPluginImpl.prototype.sendClipboardItem = | 654 remoting.ClientPluginImpl.prototype.sendClipboardItem = |
655 function(mimeType, item) { | 655 function(mimeType, item) { |
656 if (!this.hasFeature(remoting.ClientPlugin.Feature.SEND_CLIPBOARD_ITEM)) | 656 if (!this.hasFeature(remoting.ClientPlugin.Feature.SEND_CLIPBOARD_ITEM)) |
657 return; | 657 return; |
658 this.plugin_.postMessage(JSON.stringify( | 658 this.plugin_.postMessage(JSON.stringify( |
659 { method: 'sendClipboardItem', | 659 { method: 'sendClipboardItem', |
660 data: { mimeType: mimeType, item: item }})); | 660 data: { mimeType: mimeType, item: item }})); |
661 }; | 661 }; |
662 | 662 |
663 /** | 663 /** |
| 664 * Notifies the plugin whether to send touch events to the host. |
| 665 * |
| 666 * @param {boolean} enable True if touch events should be sent. |
| 667 */ |
| 668 remoting.ClientPluginImpl.prototype.enableTouchEvents = function(enable) { |
| 669 this.plugin_.postMessage( |
| 670 JSON.stringify({method: 'enableTouchEvents', data: {'enable': enable}})); |
| 671 }; |
| 672 |
| 673 /** |
664 * Notifies the host that the client has the specified size and pixel density. | 674 * Notifies the host that the client has the specified size and pixel density. |
665 * | 675 * |
666 * @param {number} width The available client width in DIPs. | 676 * @param {number} width The available client width in DIPs. |
667 * @param {number} height The available client height in DIPs. | 677 * @param {number} height The available client height in DIPs. |
668 * @param {number} device_scale The number of device pixels per DIP. | 678 * @param {number} device_scale The number of device pixels per DIP. |
669 */ | 679 */ |
670 remoting.ClientPluginImpl.prototype.notifyClientResolution = | 680 remoting.ClientPluginImpl.prototype.notifyClientResolution = |
671 function(width, height, device_scale) { | 681 function(width, height, device_scale) { |
672 this.hostDesktop_.resize(width, height, device_scale); | 682 this.hostDesktop_.resize(width, height, device_scale); |
673 }; | 683 }; |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 remoting.DefaultClientPluginFactory.prototype.preloadPlugin = function() { | 897 remoting.DefaultClientPluginFactory.prototype.preloadPlugin = function() { |
888 if (remoting.settings.CLIENT_PLUGIN_TYPE != 'pnacl') { | 898 if (remoting.settings.CLIENT_PLUGIN_TYPE != 'pnacl') { |
889 return; | 899 return; |
890 } | 900 } |
891 | 901 |
892 var plugin = remoting.ClientPluginImpl.createPluginElement_(); | 902 var plugin = remoting.ClientPluginImpl.createPluginElement_(); |
893 plugin.addEventListener( | 903 plugin.addEventListener( |
894 'loadend', function() { document.body.removeChild(plugin); }, false); | 904 'loadend', function() { document.body.removeChild(plugin); }, false); |
895 document.body.appendChild(plugin); | 905 document.body.appendChild(plugin); |
896 }; | 906 }; |
OLD | NEW |