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

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

Issue 1033913003: Touch Events capability negotiation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: back to setting a flag on DesktopEnvironmentFactory Created 5 years, 8 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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
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.
Wez 2015/04/21 02:12:12 See comments re wording on the interface,.
Rintaro Kuroiwa 2015/04/22 19:56:00 Done.
639 *
640 * @param {boolean} True if the plugin should handle touch events.
641 * @return {void} Nothing.
642 */
643 remoting.ClientPluginImpl.prototype.enableTouchEvents = function(enable) {
644 this.plugin_.postMessage(
645 JSON.stringify({method: 'enableTouchEvents', data: {'enable': enable}}));
646 };
647
648 /**
638 * Notifies the host that the client has the specified size and pixel density. 649 * Notifies the host that the client has the specified size and pixel density.
639 * 650 *
640 * @param {number} width The available client width in DIPs. 651 * @param {number} width The available client width in DIPs.
641 * @param {number} height The available client height in DIPs. 652 * @param {number} height The available client height in DIPs.
642 * @param {number} device_scale The number of device pixels per DIP. 653 * @param {number} device_scale The number of device pixels per DIP.
643 */ 654 */
644 remoting.ClientPluginImpl.prototype.notifyClientResolution = 655 remoting.ClientPluginImpl.prototype.notifyClientResolution =
645 function(width, height, device_scale) { 656 function(width, height, device_scale) {
646 this.hostDesktop_.resize(width, height, device_scale); 657 this.hostDesktop_.resize(width, height, device_scale);
647 }; 658 };
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 remoting.DefaultClientPluginFactory.prototype.preloadPlugin = function() { 867 remoting.DefaultClientPluginFactory.prototype.preloadPlugin = function() {
857 if (remoting.settings.CLIENT_PLUGIN_TYPE != 'pnacl') { 868 if (remoting.settings.CLIENT_PLUGIN_TYPE != 'pnacl') {
858 return; 869 return;
859 } 870 }
860 871
861 var plugin = remoting.ClientPluginImpl.createPluginElement_(); 872 var plugin = remoting.ClientPluginImpl.createPluginElement_();
862 plugin.addEventListener( 873 plugin.addEventListener(
863 'loadend', function() { document.body.removeChild(plugin); }, false); 874 'loadend', function() { document.body.removeChild(plugin); }, false);
864 document.body.appendChild(plugin); 875 document.body.appendChild(plugin);
865 }; 876 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698