From 06408c1d57d6521cc1acebccbdb4972d2a26ae41 Mon Sep 17 00:00:00 2001 From: kelvinp Date: Thu, 19 Mar 2015 13:21:35 -0700 Subject: [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} --- remoting/webapp/crd/js/desktop_remoting.js | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'remoting/webapp/crd/js/desktop_remoting.js') 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(); -- cgit v1.1