Chromium Code Reviews| 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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 628 remoting.ClientPluginImpl.prototype.sendClipboardItem = | 628 remoting.ClientPluginImpl.prototype.sendClipboardItem = |
| 629 function(mimeType, item) { | 629 function(mimeType, item) { |
| 630 if (!this.hasFeature(remoting.ClientPlugin.Feature.SEND_CLIPBOARD_ITEM)) | 630 if (!this.hasFeature(remoting.ClientPlugin.Feature.SEND_CLIPBOARD_ITEM)) |
| 631 return; | 631 return; |
| 632 this.plugin_.postMessage(JSON.stringify( | 632 this.plugin_.postMessage(JSON.stringify( |
| 633 { method: 'sendClipboardItem', | 633 { method: 'sendClipboardItem', |
| 634 data: { mimeType: mimeType, item: item }})); | 634 data: { mimeType: mimeType, item: item }})); |
| 635 }; | 635 }; |
| 636 | 636 |
| 637 /** | 637 /** |
| 638 * Notifies the plugin that touch events should be handled by the plugin. | |
| 639 * | |
| 640 * @return {void} Nothing. | |
| 641 */ | |
| 642 remoting.ClientPluginImpl.prototype.enableTouchEvents = function() { | |
| 643 this.plugin_.postMessage( | |
| 644 JSON.stringify({method: 'enableTouchEvents', data: {}})); | |
|
Wez
2015/03/30 17:10:07
This makes enabling touch events a one-way functio
Rintaro Kuroiwa
2015/04/08 03:27:43
Done.
| |
| 645 }; | |
| 646 | |
| 647 /** | |
| 638 * Notifies the host that the client has the specified size and pixel density. | 648 * Notifies the host that the client has the specified size and pixel density. |
| 639 * | 649 * |
| 640 * @param {number} width The available client width in DIPs. | 650 * @param {number} width The available client width in DIPs. |
| 641 * @param {number} height The available client height in DIPs. | 651 * @param {number} height The available client height in DIPs. |
| 642 * @param {number} device_scale The number of device pixels per DIP. | 652 * @param {number} device_scale The number of device pixels per DIP. |
| 643 */ | 653 */ |
| 644 remoting.ClientPluginImpl.prototype.notifyClientResolution = | 654 remoting.ClientPluginImpl.prototype.notifyClientResolution = |
| 645 function(width, height, device_scale) { | 655 function(width, height, device_scale) { |
| 646 this.hostDesktop_.resize(width, height, device_scale); | 656 this.hostDesktop_.resize(width, height, device_scale); |
| 647 }; | 657 }; |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 856 remoting.DefaultClientPluginFactory.prototype.preloadPlugin = function() { | 866 remoting.DefaultClientPluginFactory.prototype.preloadPlugin = function() { |
| 857 if (remoting.settings.CLIENT_PLUGIN_TYPE != 'pnacl') { | 867 if (remoting.settings.CLIENT_PLUGIN_TYPE != 'pnacl') { |
| 858 return; | 868 return; |
| 859 } | 869 } |
| 860 | 870 |
| 861 var plugin = remoting.ClientPluginImpl.createPluginElement_(); | 871 var plugin = remoting.ClientPluginImpl.createPluginElement_(); |
| 862 plugin.addEventListener( | 872 plugin.addEventListener( |
| 863 'loadend', function() { document.body.removeChild(plugin); }, false); | 873 'loadend', function() { document.body.removeChild(plugin); }, false); |
| 864 document.body.appendChild(plugin); | 874 document.body.appendChild(plugin); |
| 865 }; | 875 }; |
| OLD | NEW |