| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 * 'display-layout' presents a visual representation of the layout of one or | 7 * 'display-layout' presents a visual representation of the layout of one or |
| 8 * more displays and allows them to be arranged. | 8 * more displays and allows them to be arranged. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 * The ratio of the display area div (in px) to DisplayUnitInfo.bounds. | 35 * The ratio of the display area div (in px) to DisplayUnitInfo.bounds. |
| 36 * @type {number} | 36 * @type {number} |
| 37 */ | 37 */ |
| 38 visualScale: 1, | 38 visualScale: 1, |
| 39 }, | 39 }, |
| 40 | 40 |
| 41 /** @private {!{left: number, top: number}} */ | 41 /** @private {!{left: number, top: number}} */ |
| 42 visualOffset_: {left: 0, top: 0}, | 42 visualOffset_: {left: 0, top: 0}, |
| 43 | 43 |
| 44 /** @override */ | 44 /** @override */ |
| 45 detached: function() { this.initializeDrag(false); }, | 45 detached: function() { |
| 46 this.initializeDrag(false); |
| 47 }, |
| 46 | 48 |
| 47 /** | 49 /** |
| 48 * Called explicitly when |this.displays| and their associated |this.layouts| | 50 * Called explicitly when |this.displays| and their associated |this.layouts| |
| 49 * have been fetched from chrome. | 51 * have been fetched from chrome. |
| 50 * @param {!Array<!chrome.system.display.DisplayUnitInfo>} displays | 52 * @param {!Array<!chrome.system.display.DisplayUnitInfo>} displays |
| 51 * @param {!Array<!chrome.system.display.DisplayLayout>} layouts | 53 * @param {!Array<!chrome.system.display.DisplayLayout>} layouts |
| 52 */ | 54 */ |
| 53 updateDisplays: function(displays, layouts) { | 55 updateDisplays: function(displays, layouts) { |
| 54 this.displays = displays; | 56 this.displays = displays; |
| 55 this.layouts = layouts; | 57 this.layouts = layouts; |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 var top = | 226 var top = |
| 225 this.visualOffset_.top + Math.round(newBounds.top * this.visualScale); | 227 this.visualOffset_.top + Math.round(newBounds.top * this.visualScale); |
| 226 var div = this.$$('#_' + id); | 228 var div = this.$$('#_' + id); |
| 227 div.style.left = '' + left + 'px'; | 229 div.style.left = '' + left + 'px'; |
| 228 div.style.top = '' + top + 'px'; | 230 div.style.top = '' + top + 'px'; |
| 229 }, | 231 }, |
| 230 | 232 |
| 231 }); | 233 }); |
| 232 | 234 |
| 233 })(); | 235 })(); |
| OLD | NEW |