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

Unified Diff: remoting/webapp/client_plugin_async.js

Issue 12207099: Update web-app client to use plugin notifyDeviceResolution API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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/client_plugin.js ('k') | remoting/webapp/client_session.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 }}));
+ }
};
/**
« no previous file with comments | « remoting/webapp/client_plugin.js ('k') | remoting/webapp/client_session.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698