summaryrefslogtreecommitdiffstats
path: root/remoting/webapp/crd/js/desktop_remoting.js
diff options
context:
space:
mode:
authorkelvinp <kelvinp@chromium.org>2015-03-19 13:21:35 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-19 20:22:05 +0000
commit06408c1d57d6521cc1acebccbdb4972d2a26ae41 (patch)
tree38e67e4a0af7544866df6b2d358be57f944fd748 /remoting/webapp/crd/js/desktop_remoting.js
parenta8190bfa85ddd4a2f86b5dde62ccdad80b631fd9 (diff)
downloadchromium_src-06408c1d57d6521cc1acebccbdb4972d2a26ae41.zip
chromium_src-06408c1d57d6521cc1acebccbdb4972d2a26ae41.tar.gz
chromium_src-06408c1d57d6521cc1acebccbdb4972d2a26ae41.tar.bz2
[Webapp Refactor] Move key injection related functionality into the plugin layer.
This CL moves key injection logic setRemapKey() and injectKeyCombination() into the plugin layer. With this change, we no longer need to pass the default remap keys from the ApplicationDelegate through the SessionConnector to the DesktopConnectedView in order to setup a key remapping. Instead, we can simply call plugin.setRemapKeys('a->b,b->c') on the delegate. BUG=465878 Review URL: https://codereview.chromium.org/1022473004 Cr-Commit-Position: refs/heads/master@{#321419}
Diffstat (limited to 'remoting/webapp/crd/js/desktop_remoting.js')
-rw-r--r--remoting/webapp/crd/js/desktop_remoting.js22
1 files changed, 7 insertions, 15 deletions
diff --git a/remoting/webapp/crd/js/desktop_remoting.js b/remoting/webapp/crd/js/desktop_remoting.js
index 9b7e24e..0f727f0 100644
--- a/remoting/webapp/crd/js/desktop_remoting.js
+++ b/remoting/webapp/crd/js/desktop_remoting.js
@@ -156,19 +156,6 @@ remoting.DesktopRemoting.prototype.getApplicationName = function() {
};
/**
- * @return {string} The default remap keys for the current platform.
- */
-remoting.DesktopRemoting.prototype.getDefaultRemapKeys = function() {
- var remapKeys = '';
- // By default, under ChromeOS, remap the right Control key to the right
- // Win / Cmd key.
- if (remoting.platformIsChromeOS()) {
- remapKeys = '0x0700e4>0x0700e7';
- }
- return remapKeys;
-};
-
-/**
* Called when a new session has been connected.
*
* @param {remoting.ConnectionInfo} connectionInfo
@@ -198,8 +185,13 @@ remoting.DesktopRemoting.prototype.handleConnected = function(connectionInfo) {
}
this.connectedView_ = new remoting.DesktopConnectedView(
- document.getElementById('client-container'), connectionInfo,
- this.getDefaultRemapKeys());
+ document.getElementById('client-container'), connectionInfo);
+
+ // By default, under ChromeOS, remap the right Control key to the right
+ // Win / Cmd key.
+ if (remoting.platformIsChromeOS()) {
+ connectionInfo.plugin().setRemapKeys('0x0700e4>0x0700e7');
+ }
if (connectionInfo.mode() === remoting.DesktopConnectedView.Mode.ME2ME) {
var sessionConnector = remoting.app.getSessionConnector();