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

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

Issue 1033913003: Touch Events capability negotiation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change setter to public and add license header Created 5 years, 6 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
« no previous file with comments | « remoting/webapp/base/js/client_plugin.js ('k') | remoting/webapp/base/js/client_session.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 };
OLDNEW
« no previous file with comments | « remoting/webapp/base/js/client_plugin.js ('k') | remoting/webapp/base/js/client_session.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698