summaryrefslogtreecommitdiffstats
path: root/remoting/webapp
diff options
context:
space:
mode:
authorjamiewalch@chromium.org <jamiewalch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-20 03:02:58 +0000
committerjamiewalch@chromium.org <jamiewalch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-20 03:02:58 +0000
commit67809c080e613e92eea5f3241b8e797ce4185edb (patch)
treec4ae9246dac0d6784ee9fb2b332de5c4ce8de46b /remoting/webapp
parenta7fe9110edf7ad578f19655e6d86030cc01e53e2 (diff)
downloadchromium_src-67809c080e613e92eea5f3241b8e797ce4185edb.zip
chromium_src-67809c080e613e92eea5f3241b8e797ce4185edb.tar.gz
chromium_src-67809c080e613e92eea5f3241b8e797ce4185edb.tar.bz2
Propagate DPI information to web-app.
BUG=135089 TEST= Review URL: https://chromiumcodereview.appspot.com/10801003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147605 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/webapp')
-rw-r--r--remoting/webapp/client_plugin.js4
-rw-r--r--remoting/webapp/client_plugin_async.js6
-rw-r--r--remoting/webapp/client_session.js4
3 files changed, 13 insertions, 1 deletions
diff --git a/remoting/webapp/client_plugin.js b/remoting/webapp/client_plugin.js
index 9210ab7..c6b66ef 100644
--- a/remoting/webapp/client_plugin.js
+++ b/remoting/webapp/client_plugin.js
@@ -16,6 +16,10 @@ remoting.ClientPlugin = function() {
remoting.ClientPlugin.prototype.desktopWidth;
/** @type {number} Desktop height */
remoting.ClientPlugin.prototype.desktopHeight;
+/** @type {number} Desktop x DPI */
+remoting.ClientPlugin.prototype.desktopXDpi;
+/** @type {number} Desktop y DPI */
+remoting.ClientPlugin.prototype.desktopYDpi;
/** @type {function(string): void} Outgoing signaling message callback. */
remoting.ClientPlugin.prototype.onOutgoingIqHandler;
diff --git a/remoting/webapp/client_plugin_async.js b/remoting/webapp/client_plugin_async.js
index e57902eb..dd1b5cd 100644
--- a/remoting/webapp/client_plugin_async.js
+++ b/remoting/webapp/client_plugin_async.js
@@ -26,6 +26,8 @@ remoting.ClientPluginAsync = function(plugin) {
this.desktopWidth = 0;
this.desktopHeight = 0;
+ this.desktopXDpi = 96;
+ this.desktopYDpi = 96;
/** @param {string} iq The Iq stanza received from the host. */
this.onOutgoingIqHandler = function (iq) {};
@@ -162,6 +164,10 @@ remoting.ClientPluginAsync.prototype.handleMessage_ = function(messageStr) {
}
this.desktopWidth = /** @type {number} */ message.data['width'];
this.desktopHeight = /** @type {number} */ message.data['height'];
+ this.desktopXDpi = (typeof message.data['x_dpi'] == 'number') ?
+ /** @type {number} */ (message.data['x_dpi']) : 96;
+ this.desktopYDpi = (typeof message.data['y_dpi'] == 'number') ?
+ /** @type {number} */ (message.data['y_dpi']) : 96;
this.onDesktopSizeUpdateHandler();
} else if (message.method == 'onPerfStats') {
if (typeof message.data['videoBandwidth'] != 'number' ||
diff --git a/remoting/webapp/client_session.js b/remoting/webapp/client_session.js
index fbd38d3..24a5d23 100644
--- a/remoting/webapp/client_session.js
+++ b/remoting/webapp/client_session.js
@@ -555,7 +555,9 @@ remoting.ClientSession.prototype.pauseVideo = function(pause) {
remoting.ClientSession.prototype.onDesktopSizeChanged_ = function() {
console.log('desktop size changed: ' +
this.plugin.desktopWidth + 'x' +
- this.plugin.desktopHeight);
+ this.plugin.desktopHeight +' @ ' +
+ this.plugin.desktopXDpi + 'x' +
+ this.plugin.desktopYDpi + ' DPI');
this.updateDimensions();
};