summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-02 23:20:44 +0000
committerwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-02 23:20:44 +0000
commitffc2b7ad2bb716f232b7d48fc88e840baf2f4afe (patch)
treea283db0f0a5b0325aac8136ae11e8b0c3b31ccdc
parentc9755fbf878f4ae2e772168303cd9c4e2a940223 (diff)
downloadchromium_src-ffc2b7ad2bb716f232b7d48fc88e840baf2f4afe.zip
chromium_src-ffc2b7ad2bb716f232b7d48fc88e840baf2f4afe.tar.gz
chromium_src-ffc2b7ad2bb716f232b7d48fc88e840baf2f4afe.tar.bz2
Rename injectKey to injectKeyEvent and add isInjectKeyEventSupported.
BUG=105736, 120313 TEST=Will be manually testable by verifying that the Send Ctrl-Alt-Del button works, once implemented in a follow-up CL. Review URL: http://codereview.chromium.org/9959068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130250 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--remoting/webapp/client_plugin.js8
-rw-r--r--remoting/webapp/client_plugin_async.js9
-rw-r--r--remoting/webapp/client_plugin_v1.js10
3 files changed, 24 insertions, 3 deletions
diff --git a/remoting/webapp/client_plugin.js b/remoting/webapp/client_plugin.js
index bb33af6..724e689 100644
--- a/remoting/webapp/client_plugin.js
+++ b/remoting/webapp/client_plugin.js
@@ -58,6 +58,11 @@ remoting.ClientPlugin.prototype.isHiQualityScalingSupported =
function() {};
/**
+ * @return {boolean} True if the plugin supports the injectKeyEvent API.
+ */
+remoting.ClientPlugin.prototype.isInjectKeyEventSupported = function() {};
+
+/**
* Must be called for each incoming stanza received from the host.
* @param {string} iq Incoming IQ stanza.
*/
@@ -96,7 +101,8 @@ remoting.ClientPlugin.prototype.releaseAllKeys = function() {};
* @param {number} usbKeycode The USB-style code of the key to inject.
* @param {boolean} pressed True to inject a key press, False for a release.
*/
-remoting.ClientPlugin.prototype.injectKey = function(usbKeycode, pressed) {};
+remoting.ClientPlugin.prototype.injectKeyEvent =
+ function(usbKeycode, pressed) {};
/**
* Returns an associative array with a set of stats for this connection.
diff --git a/remoting/webapp/client_plugin_async.js b/remoting/webapp/client_plugin_async.js
index 53d4f31..e18471e 100644
--- a/remoting/webapp/client_plugin_async.js
+++ b/remoting/webapp/client_plugin_async.js
@@ -207,6 +207,13 @@ remoting.ClientPluginAsync.prototype.isHiQualityScalingSupported = function() {
};
/**
+ * @return {boolean} True if the plugin supports the injectKeyEvent API.
+ */
+remoting.ClientPluginAsync.prototype.isInjectKeyEventSupported = function() {
+ return this.pluginApiVersion_ >= 6;
+};
+
+/**
* @param {string} iq Incoming IQ stanza.
*/
remoting.ClientPluginAsync.prototype.onIncomingIq = function(iq) {
@@ -272,7 +279,7 @@ remoting.ClientPluginAsync.prototype.releaseAllKeys = function() {
* @param {number} usbKeycode The USB-style code of the key to inject.
* @param {boolean} pressed True to inject a key press, False for a release.
*/
-remoting.ClientPluginAsync.prototype.injectKey =
+remoting.ClientPluginAsync.prototype.injectKeyEvent =
function(usbKeycode, pressed) {
this.plugin.postMessage(JSON.stringify(
{ method: 'injectKeyEvent', data: {
diff --git a/remoting/webapp/client_plugin_v1.js b/remoting/webapp/client_plugin_v1.js
index b2ab7f9..611043d 100644
--- a/remoting/webapp/client_plugin_v1.js
+++ b/remoting/webapp/client_plugin_v1.js
@@ -148,6 +148,13 @@ remoting.ClientPluginV1.prototype.isHiQualityScalingSupported = function() {
};
/**
+ * @return {boolean} True if the plugin supports the injectKeyEvent API.
+ */
+remoting.ClientPluginV1.prototype.isInjectKeyEventSupported = function() {
+ return false;
+};
+
+/**
* @param {string} iq Incoming IQ stanza.
*/
remoting.ClientPluginV1.prototype.onIncomingIq = function(iq) {
@@ -235,6 +242,7 @@ remoting.ClientPluginV1.prototype.sendClipboardItem = function(mimeType, item) {
* @param {number} usbKeycode The USB-style code of the key to inject.
* @param {boolean} pressed True to inject a key press, False for a release.
*/
-remoting.ClientPluginV1.prototype.injectKey = function(usbKeycode, pressed) {
+remoting.ClientPluginV1.prototype.injectKeyEvent =
+ function(usbKeycode, pressed) {
return;
};