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

Side by Side Diff: chrome/browser/resources/settings/people_page/fingerprint_list.js

Issue 2893053002: md-settings: wrap lock screen dialogs in dom-if. (Closed)
Patch Set: Created 3 years, 6 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 (function() { 5 (function() {
6 'use strict'; 6 'use strict';
7 7
8 /** 8 /**
9 * The duration in ms of a background flash when a user touches the fingerprint 9 * The duration in ms of a background flash when a user touches the fingerprint
10 * sensor on this page. 10 * sensor on this page.
(...skipping 13 matching lines...) Expand all
24 properties: { 24 properties: {
25 /** 25 /**
26 * The list of fingerprint objects. 26 * The list of fingerprint objects.
27 * @private {!Array<string>} 27 * @private {!Array<string>}
28 */ 28 */
29 fingerprints_: { 29 fingerprints_: {
30 type: Array, 30 type: Array,
31 value: function() { 31 value: function() {
32 return []; 32 return [];
33 } 33 }
34 } 34 },
35
36 /** @private */
37 showSetupFingerprintDialog_: Boolean,
35 }, 38 },
36 39
37 /** @private {?settings.FingerprintBrowserProxy} */ 40 /** @private {?settings.FingerprintBrowserProxy} */
38 browserProxy_: null, 41 browserProxy_: null,
39 42
40 /** @override */ 43 /** @override */
41 attached: function() { 44 attached: function() {
42 this.addWebUIListener( 45 this.addWebUIListener(
43 'on-fingerprint-attempt-received', this.onAttemptReceived_.bind(this)); 46 'on-fingerprint-attempt-received', this.onAttemptReceived_.bind(this));
44 this.addWebUIListener('on-screen-locked', this.onScreenLocked_.bind(this)); 47 this.addWebUIListener('on-screen-locked', this.onScreenLocked_.bind(this));
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 if (success) 141 if (success)
139 this.updateFingerprintsList_(); 142 this.updateFingerprintsList_();
140 }.bind(this)); 143 }.bind(this));
141 }, 144 },
142 145
143 /** 146 /**
144 * Opens the setup fingerprint dialog. 147 * Opens the setup fingerprint dialog.
145 * @private 148 * @private
146 */ 149 */
147 openAddFingerprintDialog_: function() { 150 openAddFingerprintDialog_: function() {
148 this.$.setupFingerprint.open(); 151 this.showSetupFingerprintDialog_ = true;
152 this.async(function() {
153 var dialog = this.$$('settings-setup-fingerprint-dialog');
154 dialog.addEventListener('close',
155 this.onSetupFingerprintDialogClose_.bind(this));
stevenjb 2017/06/01 17:28:24 Instead of this, does this work in the HTML for th
dpapad 2017/06/01 17:48:44 +1. We've been following the on-close= approach in
sammiequon 2017/06/01 20:21:10 Done.
156 }.bind(this));
149 }, 157 },
150 158
151 /** @private */ 159 /** @private */
152 onSetupFingerprintDialogClose_: function() { 160 onSetupFingerprintDialogClose_: function() {
161 this.showSetupFingerprintDialog_ = false;
153 cr.ui.focusWithoutInk(assert(this.$$('#addFingerprint'))); 162 cr.ui.focusWithoutInk(assert(this.$$('#addFingerprint')));
154 this.browserProxy_.startAuthentication(); 163 this.browserProxy_.startAuthentication();
155 }, 164 },
156 165
157 /** 166 /**
158 * Close the setup fingerprint dialog when the screen is unlocked. 167 * Close the setup fingerprint dialog when the screen is unlocked.
159 * @param {boolean} screenIsLocked 168 * @param {boolean} screenIsLocked
160 * @private 169 * @private
161 */ 170 */
162 onScreenLocked_: function(screenIsLocked) { 171 onScreenLocked_: function(screenIsLocked) {
163 if (!screenIsLocked && 172 if (!screenIsLocked &&
164 settings.getCurrentRoute() == settings.Route.FINGERPRINT) { 173 settings.getCurrentRoute() == settings.Route.FINGERPRINT) {
165 this.$.setupFingerprint.close(); 174 this.onSetupFingerprintDialogClose_();
166 } 175 }
167 }, 176 },
168 }); 177 });
169 })(); 178 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698