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

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

Issue 1153923007: Add a menu option for the right-hand Ctrl -> Meta mapping. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewer feedback. Created 5 years, 6 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
« no previous file with comments | « remoting/webapp/crd/html/window_frame.html ('k') | remoting/webapp/crd/js/options_menu.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 handling user-facing aspects of the client session. 7 * Class handling user-facing aspects of the client session.
8 */ 8 */
9 9
10 'use strict'; 10 'use strict';
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 /** 99 /**
100 * @return {boolean} True if resize-to-client is enabled; false otherwise. 100 * @return {boolean} True if resize-to-client is enabled; false otherwise.
101 */ 101 */
102 remoting.DesktopConnectedView.prototype.getResizeToClient = function() { 102 remoting.DesktopConnectedView.prototype.getResizeToClient = function() {
103 if (this.viewport_) { 103 if (this.viewport_) {
104 return this.viewport_.getResizeToClient(); 104 return this.viewport_.getResizeToClient();
105 } 105 }
106 return false; 106 return false;
107 }; 107 };
108 108
109 /**
110 * @return {boolean} True if the right-hand Ctrl key is mapped to the Meta
111 * (Windows, Command) key.
112 */
113 remoting.DesktopConnectedView.prototype.getMapRightCtrl = function() {
114 return this.host_.options.remapKeys[0x0700e4] === 0x0700e7;
115 };
116
109 remoting.DesktopConnectedView.prototype.toggleStats = function() { 117 remoting.DesktopConnectedView.prototype.toggleStats = function() {
110 this.stats_.toggle(); 118 this.stats_.toggle();
111 }; 119 };
112 120
113 /** 121 /**
114 * @return {boolean} True if the connection stats is visible; false otherwise. 122 * @return {boolean} True if the connection stats is visible; false otherwise.
115 */ 123 */
116 remoting.DesktopConnectedView.prototype.isStatsVisible = function() { 124 remoting.DesktopConnectedView.prototype.isStatsVisible = function() {
117 return this.stats_.isVisible(); 125 return this.stats_.isVisible();
118 }; 126 };
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 // Fullscreen.isActive call is not guaranteed to return true until the 236 // Fullscreen.isActive call is not guaranteed to return true until the
229 // full-screen event is triggered. In apps v2, the size of the window's 237 // full-screen event is triggered. In apps v2, the size of the window's
230 // client area is calculated differently in full-screen mode, so register 238 // client area is calculated differently in full-screen mode, so register
231 // for both events. 239 // for both events.
232 this.viewport_.onResize(); 240 this.viewport_.onResize();
233 this.viewport_.enableBumpScroll(Boolean(fullscreen)); 241 this.viewport_.enableBumpScroll(Boolean(fullscreen));
234 } 242 }
235 }; 243 };
236 244
237 /** 245 /**
246 * Set whether or not the right-hand Ctrl key should send the Meta (Windows,
247 * Command) key-code.
248 *
249 * @param {boolean} enable True to enable the mapping; false to disable.
250 */
251 remoting.DesktopConnectedView.prototype.setMapRightCtrl = function(enable) {
252 if (enable === this.getMapRightCtrl()) {
253 return; // In case right Ctrl is mapped, but not to right Meta.
254 }
255
256 if (enable) {
257 this.host_.options.remapKeys[0x0700e4] = 0x0700e7;
258 } else {
259 delete this.host_.options.remapKeys[0x0700e4]
260 }
261 this.setRemapKeys(this.host_.options.remapKeys);
262 };
263
264 /**
238 * Sends a Ctrl-Alt-Del sequence to the remoting client. 265 * Sends a Ctrl-Alt-Del sequence to the remoting client.
239 * 266 *
240 * @return {void} Nothing. 267 * @return {void} Nothing.
241 */ 268 */
242 remoting.DesktopConnectedView.prototype.sendCtrlAltDel = function() { 269 remoting.DesktopConnectedView.prototype.sendCtrlAltDel = function() {
243 console.log('Sending Ctrl-Alt-Del.'); 270 console.log('Sending Ctrl-Alt-Del.');
244 this.plugin_.injectKeyCombination([0x0700e0, 0x0700e2, 0x07004c]); 271 this.plugin_.injectKeyCombination([0x0700e0, 0x0700e2, 0x07004c]);
245 }; 272 };
246 273
247 /** 274 /**
248 * Sends a Print Screen keypress to the remoting client. 275 * Sends a Print Screen keypress to the remoting client.
249 * 276 *
250 * @return {void} Nothing. 277 * @return {void} Nothing.
251 */ 278 */
252 remoting.DesktopConnectedView.prototype.sendPrintScreen = function() { 279 remoting.DesktopConnectedView.prototype.sendPrintScreen = function() {
253 console.log('Sending Print Screen.'); 280 console.log('Sending Print Screen.');
254 this.plugin_.injectKeyCombination([0x070046]); 281 this.plugin_.injectKeyCombination([0x070046]);
255 }; 282 };
256 283
257 /** 284 /**
258 * Sets and stores the key remapping setting for the current host. If set, 285 * Sets and stores the key remapping setting for the current host. If set,
259 * these mappings override the defaults for the client platform. 286 * these mappings override the defaults for the client platform.
260 * 287 *
261 * @param {!Object} remappings 288 * @param {!Object} remappings
262 */ 289 */
263 remoting.DesktopConnectedView.prototype.setRemapKeys = function(remappings) { 290 remoting.DesktopConnectedView.prototype.setRemapKeys = function(remappings) {
264 this.plugin_.setRemapKeys(remappings); 291 this.plugin_.setRemapKeys(remappings);
265 // Save the new remapping setting. 292 // Save the new remapping setting.
266 this.host_.options.remapKeys = remappings; 293 this.host_.options.remapKeys =
294 /** @type {!Object} */ (base.deepCopy(remappings));
267 this.host_.options.save(); 295 this.host_.options.save();
268 }; 296 };
269 297
270 /** @param {remoting.VideoFrameRecorder} recorder */ 298 /** @param {remoting.VideoFrameRecorder} recorder */
271 remoting.DesktopConnectedView.prototype.setVideoFrameRecorder = 299 remoting.DesktopConnectedView.prototype.setVideoFrameRecorder =
272 function(recorder) { 300 function(recorder) {
273 this.videoFrameRecorder_ = recorder; 301 this.videoFrameRecorder_ = recorder;
274 }; 302 };
275 303
276 /** 304 /**
(...skipping 16 matching lines...) Expand all
293 }; 321 };
294 322
295 /** 323 /**
296 * Starts or stops recording of video frames. 324 * Starts or stops recording of video frames.
297 */ 325 */
298 remoting.DesktopConnectedView.prototype.startStopRecording = function() { 326 remoting.DesktopConnectedView.prototype.startStopRecording = function() {
299 if (this.videoFrameRecorder_) { 327 if (this.videoFrameRecorder_) {
300 this.videoFrameRecorder_.startStopRecording(); 328 this.videoFrameRecorder_.startStopRecording();
301 } 329 }
302 }; 330 };
OLDNEW
« no previous file with comments | « remoting/webapp/crd/html/window_frame.html ('k') | remoting/webapp/crd/js/options_menu.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698