| 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-overscan-dialog' is the dialog for display overscan | 7 * 'settings-display-overscan-dialog' is the dialog for display overscan |
| 8 * adjustments. | 8 * adjustments. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 window.addEventListener('keydown', this.keyHandler_); | 36 window.addEventListener('keydown', this.keyHandler_); |
| 37 }, | 37 }, |
| 38 | 38 |
| 39 /** @override */ | 39 /** @override */ |
| 40 detached: function() { | 40 detached: function() { |
| 41 window.removeEventListener('keydown', this.keyHandler_); | 41 window.removeEventListener('keydown', this.keyHandler_); |
| 42 }, | 42 }, |
| 43 | 43 |
| 44 open: function() { | 44 open: function() { |
| 45 this.comitted_ = false; | 45 this.comitted_ = false; |
| 46 this.$.dialog.open(); | 46 this.$.dialog.showModal(); |
| 47 }, | 47 }, |
| 48 | 48 |
| 49 close: function() { | 49 close: function() { |
| 50 this.displayId = ''; // Will trigger displayIdChanged_. | 50 this.displayId = ''; // Will trigger displayIdChanged_. |
| 51 this.$.dialog.close(); | 51 |
| 52 if (this.$.dialog.open) |
| 53 this.$.dialog.close(); |
| 52 }, | 54 }, |
| 53 | 55 |
| 54 /** @private */ | 56 /** @private */ |
| 55 displayIdChanged_: function(newValue, oldValue) { | 57 displayIdChanged_: function(newValue, oldValue) { |
| 56 if (oldValue && !this.comitted_) { | 58 if (oldValue && !this.comitted_) { |
| 57 settings.display.systemDisplayApi.overscanCalibrationReset(oldValue); | 59 settings.display.systemDisplayApi.overscanCalibrationReset(oldValue); |
| 58 settings.display.systemDisplayApi.overscanCalibrationComplete(oldValue); | 60 settings.display.systemDisplayApi.overscanCalibrationComplete(oldValue); |
| 59 } | 61 } |
| 60 if (!newValue) | 62 if (!newValue) |
| 61 return; | 63 return; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 /** @type {!chrome.system.display.Insets} */ var delta = { | 139 /** @type {!chrome.system.display.Insets} */ var delta = { |
| 138 left: x, | 140 left: x, |
| 139 top: y, | 141 top: y, |
| 140 right: x, | 142 right: x, |
| 141 bottom: y, | 143 bottom: y, |
| 142 }; | 144 }; |
| 143 settings.display.systemDisplayApi.overscanCalibrationAdjust( | 145 settings.display.systemDisplayApi.overscanCalibrationAdjust( |
| 144 this.displayId, delta); | 146 this.displayId, delta); |
| 145 } | 147 } |
| 146 }); | 148 }); |
| OLD | NEW |