Index: remoting/webapp/client_plugin_async.js |
diff --git a/remoting/webapp/client_plugin_async.js b/remoting/webapp/client_plugin_async.js |
index 9103586833f0129669458a5986cc7485a30ee22a..bdda43331a69d334967aad471c8d37269c704256 100644 |
--- a/remoting/webapp/client_plugin_async.js |
+++ b/remoting/webapp/client_plugin_async.js |
@@ -385,18 +385,27 @@ remoting.ClientPluginAsync.prototype.sendClipboardItem = |
}; |
/** |
- * Notifies the host that the client has the specified dimensions. |
+ * Notifies the host that the client has the specified size and pixel density. |
* |
- * @param {number} width The available client width. |
- * @param {number} height The available client height. |
+ * @param {number} width The available client width in DIPs. |
+ * @param {number} height The available client height in DIPs. |
+ * @param {number} device_scale The number of device pixels per DIP. |
Jamie
2013/02/11 20:32:02
Does this depend on the version of the plugin? For
Wez
2013/02/11 23:05:33
See below - if the plugin doesn't support notifyCl
|
*/ |
-remoting.ClientPluginAsync.prototype.notifyClientDimensions = |
- function(width, height) { |
- if (!this.hasFeature(remoting.ClientPlugin.Feature.NOTIFY_CLIENT_DIMENSIONS)) |
- return; |
- this.plugin.postMessage(JSON.stringify( |
- { method: 'notifyClientDimensions', |
- data: { width: width, height: height }})); |
+remoting.ClientPluginAsync.prototype.notifyClientResolution = |
+ function(width, height, device_scale) { |
+ if (this.hasFeature(remoting.ClientPlugin.Feature.NOTIFY_CLIENT_RESOLUTION)) { |
+ var dpi = device_scale * 96; |
+ this.plugin.postMessage(JSON.stringify( |
+ { method: 'notifyClientResolution', |
+ data: { width: width * device_scale, |
+ height: height * device_scale, |
+ x_dpi: dpi, y_dpi: dpi }})); |
+ } else if (this.hasFeature( |
+ remoting.ClientPlugin.Feature.NOTIFY_CLIENT_DIMENSIONS)) { |
+ this.plugin.postMessage(JSON.stringify( |
+ { method: 'notifyClientDimensions', |
+ data: { width: width, height: height }})); |
+ } |
}; |
/** |