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

Side by Side Diff: remoting/webapp/base/js/message_window.js

Issue 654393005: [Chromoting] Update size to use inner/outer bounds (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 'use strict'; 5 'use strict';
6 6
7 /** 7 /**
8 * @constructor 8 * @constructor
9 */ 9 */
10 function MessageWindowImpl() { 10 function MessageWindowImpl() {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // Make sure that the reply we're ignoring is from the window close. 42 // Make sure that the reply we're ignoring is from the window close.
43 base.debug.assert(result == 0); 43 base.debug.assert(result == 0);
44 } 44 }
45 }; 45 };
46 46
47 /** 47 /**
48 * Size the window to its content vertically. 48 * Size the window to its content vertically.
49 * @private 49 * @private
50 */ 50 */
51 MessageWindowImpl.prototype.updateSize_ = function() { 51 MessageWindowImpl.prototype.updateSize_ = function() {
52 var borderY = window.outerHeight - window.innerHeight; 52 var outerBounds = chrome.app.window.current().outerBounds;
53 window.resizeTo(window.outerWidth, document.body.clientHeight + borderY); 53 var innerBounds = chrome.app.window.current().innerBounds;
54 var borderY = outerBounds.height - innerBounds.height;
55 window.resizeTo(outerBounds.width, document.body.clientHeight + borderY);
56 // Sometimes, resizing the window causes its position to be reset to (0, 0),
57 // so restore it explicitly.
58 window.moveTo(outerBounds.left, outerBounds.top);
54 }; 59 };
55 60
56 /** 61 /**
57 * Initializes the button with the label and the click handler. 62 * Initializes the button with the label and the click handler.
58 * Hides the button if the label is null or undefined. 63 * Hides the button if the label is null or undefined.
59 * 64 *
60 * @param{HTMLElement} button 65 * @param{HTMLElement} button
61 * @param{?string} label 66 * @param{?string} label
62 * @param{Function} clickHandler 67 * @param{Function} clickHandler
63 * @private 68 * @private
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 161
157 this.updateSize_(); 162 this.updateSize_();
158 break; 163 break;
159 164
160 default: 165 default:
161 console.error('Unexpected message:', event.data); 166 console.error('Unexpected message:', event.data);
162 } 167 }
163 }; 168 };
164 169
165 var messageWindow = new MessageWindowImpl(); 170 var messageWindow = new MessageWindowImpl();
OLDNEW
« no previous file with comments | « no previous file | remoting/webapp/js_proto/chrome_proto.js » ('j') | remoting/webapp/js_proto/chrome_proto.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698