| 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 * 'settings-display' is the settings subpage for display settings. | 7 * 'settings-display' is the settings subpage for display settings. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 cr.define('settings.display', function() { | 10 cr.define('settings.display', function() { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 /** @private */ | 111 /** @private */ |
| 112 getDisplayInfo_: function() { | 112 getDisplayInfo_: function() { |
| 113 settings.display.systemDisplayApi.getInfo( | 113 settings.display.systemDisplayApi.getInfo( |
| 114 this.displayInfoFetched_.bind(this)); | 114 this.displayInfoFetched_.bind(this)); |
| 115 }, | 115 }, |
| 116 | 116 |
| 117 /** | 117 /** |
| 118 * @param {!Array<!chrome.system.display.DisplayUnitInfo>} displays | 118 * @param {!Array<!chrome.system.display.DisplayUnitInfo>} displays |
| 119 * @private | 119 * @private |
| 120 */ | 120 */ |
| 121 displayInfoFetched_(displays) { | 121 displayInfoFetched_: function(displays) { |
| 122 if (!displays.length) | 122 if (!displays.length) |
| 123 return; | 123 return; |
| 124 settings.display.systemDisplayApi.getDisplayLayout( | 124 settings.display.systemDisplayApi.getDisplayLayout( |
| 125 this.displayLayoutFetched_.bind(this, displays)); | 125 this.displayLayoutFetched_.bind(this, displays)); |
| 126 }, | 126 }, |
| 127 | 127 |
| 128 /** | 128 /** |
| 129 * @param {!Array<!chrome.system.display.DisplayUnitInfo>} displays | 129 * @param {!Array<!chrome.system.display.DisplayUnitInfo>} displays |
| 130 * @param {!Array<!chrome.system.display.DisplayLayout>} layouts | 130 * @param {!Array<!chrome.system.display.DisplayLayout>} layouts |
| 131 * @private | 131 * @private |
| 132 */ | 132 */ |
| 133 displayLayoutFetched_(displays, layouts) { | 133 displayLayoutFetched_: function(displays, layouts) { |
| 134 this.layouts = layouts; | 134 this.layouts = layouts; |
| 135 this.displays = displays; | 135 this.displays = displays; |
| 136 this.updateDisplayInfo_(); | 136 this.updateDisplayInfo_(); |
| 137 }, | 137 }, |
| 138 | 138 |
| 139 /** | 139 /** |
| 140 * @param {!chrome.system.display.DisplayUnitInfo} selectedDisplay | 140 * @param {!chrome.system.display.DisplayUnitInfo} selectedDisplay |
| 141 * @return {number} | 141 * @return {number} |
| 142 * @private | 142 * @private |
| 143 */ | 143 */ |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 }, | 437 }, |
| 438 | 438 |
| 439 /** @private */ | 439 /** @private */ |
| 440 setPropertiesCallback_: function() { | 440 setPropertiesCallback_: function() { |
| 441 if (chrome.runtime.lastError) { | 441 if (chrome.runtime.lastError) { |
| 442 console.error( | 442 console.error( |
| 443 'setDisplayProperties Error: ' + chrome.runtime.lastError.message); | 443 'setDisplayProperties Error: ' + chrome.runtime.lastError.message); |
| 444 } | 444 } |
| 445 }, | 445 }, |
| 446 }); | 446 }); |
| OLD | NEW |