| OLD | NEW |
| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 remoting.WindowShape.prototype.updateClientWindowShape = function() { | 63 remoting.WindowShape.prototype.updateClientWindowShape = function() { |
| 64 if (!remoting.WindowShape.isSupported()) { | 64 if (!remoting.WindowShape.isSupported()) { |
| 65 return; | 65 return; |
| 66 } | 66 } |
| 67 | 67 |
| 68 var rects = this.desktopRects_.slice(); | 68 var rects = this.desktopRects_.slice(); |
| 69 for (var i = 0; i < this.clientUICallbacks_.length; ++i) { | 69 for (var i = 0; i < this.clientUICallbacks_.length; ++i) { |
| 70 this.clientUICallbacks_[i].addToRegion(rects); | 70 this.clientUICallbacks_[i].addToRegion(rects); |
| 71 } | 71 } |
| 72 for (var i = 0; i < rects.length; ++i) { | 72 for (var i = 0; i < rects.length; ++i) { |
| 73 /** @type {ClientRect} */ | 73 var rect = /** @type {ClientRect} */ (rects[i]); |
| 74 var rect = rects[i]; | |
| 75 var left = Math.floor(rect.left); | 74 var left = Math.floor(rect.left); |
| 76 var right = Math.ceil(rect.left + rect.width); | 75 var right = Math.ceil(rect.left + rect.width); |
| 77 var top = Math.floor(rect.top); | 76 var top = Math.floor(rect.top); |
| 78 var bottom = Math.ceil(rect.top + rect.height); | 77 var bottom = Math.ceil(rect.top + rect.height); |
| 79 rects[i] = { left: left, | 78 rects[i] = { left: left, |
| 80 top: top, | 79 top: top, |
| 81 width: right - left, | 80 width: right - left, |
| 82 height: bottom - top }; | 81 height: bottom - top }; |
| 83 } | 82 } |
| 84 chrome.app.window.current().setShape({rects: rects}); | 83 chrome.app.window.current().setShape({rects: rects}); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 95 * Add the context menu's bounding rectangle to the specified region. | 94 * Add the context menu's bounding rectangle to the specified region. |
| 96 * | 95 * |
| 97 * @param {Array.<{left: number, top: number, width: number, height: number}>} | 96 * @param {Array.<{left: number, top: number, width: number, height: number}>} |
| 98 * rects | 97 * rects |
| 99 */ | 98 */ |
| 100 remoting.WindowShape.ClientUI.prototype.addToRegion = function(rects) {}; | 99 remoting.WindowShape.ClientUI.prototype.addToRegion = function(rects) {}; |
| 101 | 100 |
| 102 | 101 |
| 103 /** @type {remoting.WindowShape} */ | 102 /** @type {remoting.WindowShape} */ |
| 104 remoting.windowShape = new remoting.WindowShape(); | 103 remoting.windowShape = new remoting.WindowShape(); |
| OLD | NEW |