Commit d5ea2ad0 authored by garykac's avatar garykac Committed by Commit bot

[Chromoting] Update size to use inner/outer bounds

BUG=

Review URL: https://codereview.chromium.org/654393005

Cr-Commit-Position: refs/heads/master@{#301388}
parent 6d99f5fd
......@@ -49,8 +49,13 @@ MessageWindowImpl.prototype.sendReply_ = function(
* @private
*/
MessageWindowImpl.prototype.updateSize_ = function() {
var borderY = window.outerHeight - window.innerHeight;
window.resizeTo(window.outerWidth, document.body.clientHeight + borderY);
var outerBounds = chrome.app.window.current().outerBounds;
var innerBounds = chrome.app.window.current().innerBounds;
var borderY = outerBounds.height - innerBounds.height;
window.resizeTo(outerBounds.width, document.body.clientHeight + borderY);
// Sometimes, resizing the window causes its position to be reset to (0, 0),
// so restore it explicitly.
window.moveTo(outerBounds.left, outerBounds.top);
};
/**
......
......@@ -364,6 +364,10 @@ var AppWindow = function() {
this.onFullscreened = null;
/** @type {string} */
this.id = '';
/** @type {Bounds} */
this.outerBounds = null;
/** @type {Bounds} */
this.innerBounds = null;
};
AppWindow.prototype.close = function() {};
......@@ -399,6 +403,18 @@ var LaunchData = function() {
this.items = [];
};
/** @constructor */
function Bounds() {
/** @type {number} */
this.left = 0;
/** @type {number} */
this.top = 0;
/** @type {number} */
this.width = 0;
/** @type {number} */
this.height = 0;
};
/** @constructor */
function ClientRect() {
/** @type {number} */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment