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

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

Issue 1146833002: [AppRemoting] Implement ConnectionDroppedDialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WindowShape fixes + reviewer's feedback Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « remoting/webapp/base/js/modal_dialogs.js ('k') | remoting/webapp/files.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * Class handling setting of the local app window shape to account for windows 7 * Class handling setting of the local app window shape to account for windows
8 * on the remote desktop, as well as any client-side UI. 8 * on the remote desktop, as well as any client-side UI.
9 */ 9 */
10 10
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 desktop.right = Math.max(rect.left + rect.width, desktop.right); 83 desktop.right = Math.max(rect.left + rect.width, desktop.right);
84 desktop.top = Math.min(rect.top, desktop.top); 84 desktop.top = Math.min(rect.top, desktop.top);
85 desktop.bottom = Math.max(rect.top + rect.height, desktop.bottom); 85 desktop.bottom = Math.max(rect.top + rect.height, desktop.bottom);
86 }); 86 });
87 } 87 }
88 88
89 // Center the element to the desktop window bounding rect. 89 // Center the element to the desktop window bounding rect.
90 var rect = element.getBoundingClientRect(); 90 var rect = element.getBoundingClientRect();
91 var left = (desktop.right - desktop.left - rect.width) / 2 + desktop.left; 91 var left = (desktop.right - desktop.left - rect.width) / 2 + desktop.left;
92 var top = (desktop.bottom - desktop.top - rect.height) / 2 + desktop.top; 92 var top = (desktop.bottom - desktop.top - rect.height) / 2 + desktop.top;
93 element.style.left = left + 'px'; 93 element.style.left = Math.round(left) + 'px';
94 element.style.top = top + 'px'; 94 element.style.top = Math.round(top) + 'px';
95 this.updateClientWindowShape(); 95 this.updateClientWindowShape();
96 }; 96 };
97 97
98 /** 98 /**
99 * Sets the region associated with the remote desktop windows. 99 * Sets the region associated with the remote desktop windows.
100 * 100 *
101 * @param {Array<{left: number, top: number, width: number, height: number}>} 101 * @param {Array<{left: number, top: number, width: number, height: number}>}
102 * rects 102 * rects
103 */ 103 */
104 remoting.WindowShape.prototype.setDesktopRects = function(rects) { 104 remoting.WindowShape.prototype.setDesktopRects = function(rects) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 * Adds the context menu's bounding rectangle to the specified region. 143 * Adds the context menu's bounding rectangle to the specified region.
144 * 144 *
145 * @param {Array<{left: number, top: number, width: number, height: number}>} 145 * @param {Array<{left: number, top: number, width: number, height: number}>}
146 * rects 146 * rects
147 */ 147 */
148 remoting.WindowShape.ClientUI.prototype.addToRegion = function(rects) {}; 148 remoting.WindowShape.ClientUI.prototype.addToRegion = function(rects) {};
149 149
150 150
151 /** @type {remoting.WindowShape} */ 151 /** @type {remoting.WindowShape} */
152 remoting.windowShape = new remoting.WindowShape(); 152 remoting.windowShape = new remoting.WindowShape();
OLDNEW
« no previous file with comments | « remoting/webapp/base/js/modal_dialogs.js ('k') | remoting/webapp/files.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698