Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: chrome/browser/resources/settings/device_page/display_overscan_dialog.js

Issue 2180823004: Migrate <cr-dialog> from PaperDialogBehavior to native <dialog>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698