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

Unified Diff: remoting/webapp/client_session.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
Index: remoting/webapp/client_session.js
diff --git a/remoting/webapp/client_session.js b/remoting/webapp/client_session.js
index 522bca8b4eb015557a7363dcfe66a29603f1721c..35c4b0329546c3f281ba5e3208d083211d9868e3 100644
--- a/remoting/webapp/client_session.js
+++ b/remoting/webapp/client_session.js
@@ -64,7 +64,7 @@ remoting.ClientSession = function(hostJid, clientJid,
this.onStateChange_ = null;
/** @type {number?} @private */
- this.notifyClientDimensionsTimer_ = null;
+ this.notifyClientResolutionTimer_ = null;
/** @type {number?} @private */
this.bumpScrollTimer_ = null;
@@ -504,7 +504,9 @@ remoting.ClientSession.prototype.setScreenMode_ =
function(shrinkToFit, resizeToClient) {
if (resizeToClient && !this.resizeToClient_) {
- this.plugin.notifyClientDimensions(window.innerWidth, window.innerHeight);
+ this.plugin.notifyClientResolution(window.innerWidth,
+ window.innerHeight,
+ window.devicePixelRatio);
}
// If enabling shrink, reset bump-scroll offsets.
@@ -627,7 +629,9 @@ remoting.ClientSession.prototype.onConnectionStatusUpdate_ =
if (status == remoting.ClientSession.State.CONNECTED) {
this.onDesktopSizeChanged_();
if (this.resizeToClient_) {
- this.plugin.notifyClientDimensions(window.innerWidth, window.innerHeight);
+ this.plugin.notifyClientResolution(window.innerWidth,
+ window.innerHeight,
+ window.devicePixelRatio);
}
} else if (status == remoting.ClientSession.State.FAILED) {
this.error_ = /** @type {remoting.ClientSession.ConnectionError} */ (error);
@@ -688,18 +692,19 @@ remoting.ClientSession.prototype.setState_ = function(newState) {
remoting.ClientSession.prototype.onResize = function() {
this.updateDimensions();
- if (this.notifyClientDimensionsTimer_) {
- window.clearTimeout(this.notifyClientDimensionsTimer_);
- this.notifyClientDimensionsTimer_ = null;
+ if (this.notifyClientResolutionTimer_) {
+ window.clearTimeout(this.notifyClientResolutionTimer_);
+ this.notifyClientResolutionTimer_ = null;
}
// Defer notifying the host of the change until the window stops resizing, to
// avoid overloading the control channel with notifications.
if (this.resizeToClient_) {
- this.notifyClientDimensionsTimer_ = window.setTimeout(
- this.plugin.notifyClientDimensions.bind(this.plugin,
+ this.notifyClientResolutionTimer_ = window.setTimeout(
+ this.plugin.notifyClientResolution.bind(this.plugin,
window.innerWidth,
- window.innerHeight),
+ window.innerHeight,
+ window.devicePixelRatio),
1000);
}
« remoting/webapp/client_plugin_async.js ('K') | « remoting/webapp/client_plugin_async.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698