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

Unified Diff: remoting/webapp/crd/js/desktop_connected_view.js

Issue 1358173005: Refactor HostSettings class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit tests. Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/crd/js/crd_experimental.js ('k') | remoting/webapp/crd/js/desktop_remoting_activity.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/desktop_connected_view.js
diff --git a/remoting/webapp/crd/js/desktop_connected_view.js b/remoting/webapp/crd/js/desktop_connected_view.js
index 1f528d36909c8a7c9ad8140dfe45d9fbcf3baf47..22cbf4bab41a06d003e34d83061f0649f04535cf 100644
--- a/remoting/webapp/crd/js/desktop_connected_view.js
+++ b/remoting/webapp/crd/js/desktop_connected_view.js
@@ -111,7 +111,7 @@ remoting.DesktopConnectedView.prototype.getResizeToClient = function() {
* (Windows, Command) key.
*/
remoting.DesktopConnectedView.prototype.getMapRightCtrl = function() {
- return this.host_.options.remapKeys[0x0700e4] === 0x0700e7;
+ return this.host_.options.getRemapKeys()[0x0700e4] === 0x0700e7;
};
remoting.DesktopConnectedView.prototype.toggleStats = function() {
@@ -255,12 +255,13 @@ remoting.DesktopConnectedView.prototype.setMapRightCtrl = function(enable) {
return; // In case right Ctrl is mapped, but not to right Meta.
}
+ var remapKeys = this.host_.options.getRemapKeys();
if (enable) {
- this.host_.options.remapKeys[0x0700e4] = 0x0700e7;
+ remapKeys[0x0700e4] = 0x0700e7;
} else {
- delete this.host_.options.remapKeys[0x0700e4]
+ delete remapKeys[0x0700e4]
}
- this.setRemapKeys(this.host_.options.remapKeys);
+ this.setRemapKeys(remapKeys);
};
/**
@@ -287,14 +288,13 @@ remoting.DesktopConnectedView.prototype.sendPrintScreen = function() {
* Sets and stores the key remapping setting for the current host. If set,
* these mappings override the defaults for the client platform.
*
- * @param {!Object} remappings
+ * @param {string|!Object} remappings
*/
remoting.DesktopConnectedView.prototype.setRemapKeys = function(remappings) {
- this.plugin_.setRemapKeys(remappings);
// Save the new remapping setting.
- this.host_.options.remapKeys =
- /** @type {!Object} */ (base.deepCopy(remappings));
+ this.host_.options.setRemapKeys(remappings);
this.host_.options.save();
+ this.plugin_.setRemapKeys(this.host_.options.getRemapKeys());
};
/** @param {remoting.VideoFrameRecorder} recorder */
@@ -341,4 +341,4 @@ remoting.DesktopConnectedView.prototype.startStopRecording = function() {
*/
remoting.DesktopConnectedView.create = function(container, connectionInfo) {
return new remoting.DesktopConnectedView(container, connectionInfo);
-};
+};
« no previous file with comments | « remoting/webapp/crd/js/crd_experimental.js ('k') | remoting/webapp/crd/js/desktop_remoting_activity.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698