| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.exportPath('options'); | 5 cr.exportPath('options'); |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Enumeration of display layout. These values must match the C++ values in | 8 * Enumeration of display layout. These values must match the C++ values in |
| 9 * ash::DisplayController. | 9 * ash::DisplayController. |
| 10 * @enum {number} | 10 * @enum {number} |
| (...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1036 var offset = { | 1036 var offset = { |
| 1037 x: Math.floor( | 1037 x: Math.floor( |
| 1038 this.displaysView_.offsetWidth / 2 - | 1038 this.displaysView_.offsetWidth / 2 - |
| 1039 (boundingBox.right + boundingBox.left) * this.visualScale_ / 2), | 1039 (boundingBox.right + boundingBox.left) * this.visualScale_ / 2), |
| 1040 y: Math.floor( | 1040 y: Math.floor( |
| 1041 this.displaysView_.offsetHeight / 2 - | 1041 this.displaysView_.offsetHeight / 2 - |
| 1042 (boundingBox.bottom + boundingBox.top) * this.visualScale_ / 2) | 1042 (boundingBox.bottom + boundingBox.top) * this.visualScale_ / 2) |
| 1043 }; | 1043 }; |
| 1044 | 1044 |
| 1045 // Layout the display rectangles. First layout the primary display and | 1045 // Layout the display rectangles. First layout the primary display and |
| 1046 // then layout the secondary which is attached to the primary. | 1046 // then layout any secondary displays. |
| 1047 this.createDisplayLayoutDiv_( |
| 1048 this.displayLayoutMap_[this.primaryDisplayId_], layoutType, offset); |
| 1047 for (var i = 0; i < this.displays_.length; i++) { | 1049 for (var i = 0; i < this.displays_.length; i++) { |
| 1048 this.createDisplayLayoutDiv_( | 1050 if (!this.displays_[i].isPrimary) { |
| 1049 this.displayLayoutMap_[this.displays_[i].id], layoutType, offset); | 1051 this.createDisplayLayoutDiv_( |
| 1052 this.displayLayoutMap_[this.displays_[i].id], layoutType, offset); |
| 1053 } |
| 1050 } | 1054 } |
| 1051 }, | 1055 }, |
| 1052 | 1056 |
| 1053 /** | 1057 /** |
| 1054 * Called when the display arrangement has changed. | 1058 * Called when the display arrangement has changed. |
| 1055 * @param {options.MultiDisplayMode} mode multi display mode. | 1059 * @param {options.MultiDisplayMode} mode multi display mode. |
| 1056 * @param {!Array<!options.DisplayInfo>} displays The list of the display | 1060 * @param {!Array<!options.DisplayInfo>} displays The list of the display |
| 1057 * information. | 1061 * information. |
| 1058 * @param {options.DisplayLayoutType} layoutType The layout strategy. | 1062 * @param {options.DisplayLayoutType} layoutType The layout strategy. |
| 1059 * @param {number} offset The offset of the secondary display. | 1063 * @param {number} offset The offset of the secondary display. |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1118 mode, displays, layoutType, offset) { | 1122 mode, displays, layoutType, offset) { |
| 1119 DisplayOptions.getInstance().onDisplayChanged_( | 1123 DisplayOptions.getInstance().onDisplayChanged_( |
| 1120 mode, displays, layoutType, offset); | 1124 mode, displays, layoutType, offset); |
| 1121 }; | 1125 }; |
| 1122 | 1126 |
| 1123 // Export | 1127 // Export |
| 1124 return { | 1128 return { |
| 1125 DisplayOptions: DisplayOptions | 1129 DisplayOptions: DisplayOptions |
| 1126 }; | 1130 }; |
| 1127 }); | 1131 }); |
| OLD | NEW |