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
3 // found in the LICENSE file.
7 * Experimental features that can be accessed via the Chrome debugging console.
12 /** @suppress {duplicate} */
13 var remoting = remoting || {};
15 remoting.experimental = {};
18 * Enables or disables rendering of dirty regions for debugging.
19 * @param {boolean} enable True to enable rendering.
21 remoting.experimental.enableDebugRegion = function(enable) {
22 var drApp = /** @type {remoting.DesktopRemoting} */ (remoting.app);
23 if (drApp instanceof remoting.DesktopRemoting) {
24 var desktopConnectedView = drApp.getConnectedViewForTesting();
25 var connectedView = desktopConnectedView.getConnectedViewForTesting();
26 connectedView.enableDebugRegion(enable);
31 * Sets and stores the scale factor to apply to host sizing requests.
32 * The desktopScale applies to the dimensions reported to the host, not
33 * to the client DPI reported to it.
35 * @param {number} desktopScale Scale factor to apply.
37 remoting.experimental.setDesktopScale = function(desktopScale) {
38 var drApp = /** @type {remoting.DesktopRemoting} */ (remoting.app);
39 if (drApp instanceof remoting.DesktopRemoting) {
40 var connectedView = drApp.getConnectedViewForTesting();
41 var viewport = connectedView.getViewportForTesting();
42 viewport.setDesktopScale(desktopScale);
47 * Sets and stores the key remapping setting for the current host. If set,
48 * these mappings override the defaults for the client platform.
50 * @param {string} remappings Comma-separated list of key remappings.
52 remoting.experimental.setRemapKeys = function(remappings) {
53 var drApp = /** @type {remoting.DesktopRemoting} */ (remoting.app);
54 if (drApp instanceof remoting.DesktopRemoting) {
55 var connectedView = drApp.getConnectedViewForTesting();
56 connectedView.setRemapKeys(
57 remoting.Host.Options.convertRemapKeys(remappings));