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 * @typedef {{ | 8 * @typedef {{ |
9 * availableColorProfiles: Array.<{profileId: number, name: string}>, | 9 * availableColorProfiles: Array<{profileId: number, name: string}>, |
10 * colorProfile: number, | 10 * colorProfile: number, |
11 * height: number, | 11 * height: number, |
12 * id: string, | 12 * id: string, |
13 * isInternal: boolean, | 13 * isInternal: boolean, |
14 * isPrimary: boolean, | 14 * isPrimary: boolean, |
15 * resolutions: Array.<{width: number, height: number, originalWidth: number, | 15 * resolutions: Array<{width: number, height: number, originalWidth: number, |
16 * originalHeight: number, deviceScaleFactor: number, scale: number, | 16 * originalHeight: number, deviceScaleFactor: number, scale: number, |
17 * refreshRate: number, isBest: boolean, selected: boolean}>, | 17 * refreshRate: number, isBest: boolean, selected: boolean}>, |
18 * name: string, | 18 * name: string, |
19 * orientation: number, | 19 * orientation: number, |
20 * width: number, | 20 * width: number, |
21 * x: number, | 21 * x: number, |
22 * y: number | 22 * y: number |
23 * }} | 23 * }} |
24 */ | 24 */ |
25 options.DisplayInfo; | 25 options.DisplayInfo; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 118 |
119 /** | 119 /** |
120 * The current secondary display layout. | 120 * The current secondary display layout. |
121 * @private | 121 * @private |
122 */ | 122 */ |
123 layout_: options.SecondaryDisplayLayout.RIGHT, | 123 layout_: options.SecondaryDisplayLayout.RIGHT, |
124 | 124 |
125 /** | 125 /** |
126 * The array of current output displays. It also contains the display | 126 * The array of current output displays. It also contains the display |
127 * rectangles currently rendered on screen. | 127 * rectangles currently rendered on screen. |
128 * @type {Array.<options.DisplayInfo>} | 128 * @type {Array<options.DisplayInfo>} |
129 * @private | 129 * @private |
130 */ | 130 */ |
131 displays_: [], | 131 displays_: [], |
132 | 132 |
133 /** | 133 /** |
134 * The index for the currently focused display in the options UI. null if | 134 * The index for the currently focused display in the options UI. null if |
135 * no one has focus. | 135 * no one has focus. |
136 * @private | 136 * @private |
137 */ | 137 */ |
138 focusedIndex_: null, | 138 focusedIndex_: null, |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 break; | 899 break; |
900 } | 900 } |
901 this.secondaryDisplay_.originalPosition = { | 901 this.secondaryDisplay_.originalPosition = { |
902 x: secondaryDiv.offsetLeft, y: secondaryDiv.offsetTop}; | 902 x: secondaryDiv.offsetLeft, y: secondaryDiv.offsetTop}; |
903 } | 903 } |
904 }, | 904 }, |
905 | 905 |
906 /** | 906 /** |
907 * Called when the display arrangement has changed. | 907 * Called when the display arrangement has changed. |
908 * @param {boolean} mirroring Whether current mode is mirroring or not. | 908 * @param {boolean} mirroring Whether current mode is mirroring or not. |
909 * @param {Array.<options.DisplayInfo>} displays The list of the display | 909 * @param {Array<options.DisplayInfo>} displays The list of the display |
910 * information. | 910 * information. |
911 * @param {options.SecondaryDisplayLayout} layout The layout strategy. | 911 * @param {options.SecondaryDisplayLayout} layout The layout strategy. |
912 * @param {number} offset The offset of the secondary display. | 912 * @param {number} offset The offset of the secondary display. |
913 * @private | 913 * @private |
914 */ | 914 */ |
915 onDisplayChanged_: function(mirroring, displays, layout, offset) { | 915 onDisplayChanged_: function(mirroring, displays, layout, offset) { |
916 if (!this.visible) | 916 if (!this.visible) |
917 return; | 917 return; |
918 | 918 |
919 var hasExternal = false; | 919 var hasExternal = false; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 mirroring, displays, layout, offset) { | 956 mirroring, displays, layout, offset) { |
957 DisplayOptions.getInstance().onDisplayChanged_( | 957 DisplayOptions.getInstance().onDisplayChanged_( |
958 mirroring, displays, layout, offset); | 958 mirroring, displays, layout, offset); |
959 }; | 959 }; |
960 | 960 |
961 // Export | 961 // Export |
962 return { | 962 return { |
963 DisplayOptions: DisplayOptions | 963 DisplayOptions: DisplayOptions |
964 }; | 964 }; |
965 }); | 965 }); |
OLD | NEW |