OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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('settings'); | 5 cr.exportPath('settings'); |
6 | 6 |
7 /** | 7 /** |
8 * The steps in the fingerprint setup flow. | 8 * The steps in the fingerprint setup flow. |
9 * @enum {number} | 9 * @enum {number} |
10 */ | 10 */ |
11 settings.FingerprintSetupStep = { | 11 settings.FingerprintSetupStep = { |
12 LOCATE_SCANNER: 1, // The user needs to locate the scanner. | 12 LOCATE_SCANNER: 1, // The user needs to locate the scanner. |
13 MOVE_FINGER: 2, // The user needs to move finger around the scanner. | 13 MOVE_FINGER: 2, // The user needs to move finger around the scanner. |
14 READY: 3 // The scanner has read the fingerprint successfully. | 14 READY: 3 // The scanner has read the fingerprint successfully. |
15 }; | 15 }; |
16 | 16 |
17 (function() { | 17 (function() { |
18 | 18 |
19 /** | 19 /** |
20 * The duration in ms of a fingerprint icon flash when a user touches the | 20 * The duration in ms of a fingerprint icon flash when a user touches the |
21 * fingerprint sensor during an enroll session. | 21 * fingerprint sensor during an enroll session. |
22 * @const {number} | 22 * @const {number} |
23 */ | 23 */ |
24 var FLASH_DURATION_MS = 300; | 24 var FLASH_DURATION_MS = 300; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 /** | 97 /** |
98 * Closes the dialog. | 98 * Closes the dialog. |
99 */ | 99 */ |
100 close: function() { | 100 close: function() { |
101 if (this.$.dialog.open) | 101 if (this.$.dialog.open) |
102 this.$.dialog.close(); | 102 this.$.dialog.close(); |
103 | 103 |
104 // Note: Reset resets |step_| back to the default, so handle anything that | 104 // Note: Reset resets |step_| back to the default, so handle anything that |
105 // checks |step_| before resetting. | 105 // checks |step_| before resetting. |
106 if(this.step_ == settings.FingerprintSetupStep.READY) | 106 if (this.step_ == settings.FingerprintSetupStep.READY) |
107 this.fire('add-fingerprint'); | 107 this.fire('add-fingerprint'); |
108 else | 108 else |
109 this.browserProxy_.cancelCurrentEnroll(); | 109 this.browserProxy_.cancelCurrentEnroll(); |
110 | 110 |
111 this.reset_(); | 111 this.reset_(); |
112 }, | 112 }, |
113 | 113 |
114 /** private */ | 114 /** private */ |
115 clearSensorMessageTimeout_: function() { | 115 clearSensorMessageTimeout_: function() { |
116 if (this.tapSensorMessageTimeoutId_ != 0) { | 116 if (this.tapSensorMessageTimeoutId_ != 0) { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 if (scan.result == settings.FingerprintResultType.SUCCESS) { | 169 if (scan.result == settings.FingerprintResultType.SUCCESS) { |
170 this.problemMessage_ = ''; | 170 this.problemMessage_ = ''; |
171 // Flash the fingerprint icon blue so that users get some feedback | 171 // Flash the fingerprint icon blue so that users get some feedback |
172 // when a successful scan has been registered. | 172 // when a successful scan has been registered. |
173 this.$.image.animate( | 173 this.$.image.animate( |
174 { | 174 { |
175 fill: ['var(--google-blue-700)', 'var(--google-grey-500)'], | 175 fill: ['var(--google-blue-700)', 'var(--google-grey-500)'], |
176 opacity: [0.7, 1.0], | 176 opacity: [0.7, 1.0], |
177 }, | 177 }, |
178 FLASH_DURATION_MS); | 178 FLASH_DURATION_MS); |
179 this.$.arc.animate(this.receivedScanCount_ * slice, | 179 this.$.arc.animate( |
| 180 this.receivedScanCount_ * slice, |
180 (this.receivedScanCount_ + 1) * slice); | 181 (this.receivedScanCount_ + 1) * slice); |
181 this.receivedScanCount_++; | 182 this.receivedScanCount_++; |
182 } | 183 } |
183 } | 184 } |
184 break; | 185 break; |
185 case settings.FingerprintSetupStep.READY: | 186 case settings.FingerprintSetupStep.READY: |
186 break; | 187 break; |
187 default: | 188 default: |
188 assertNotReached(); | 189 assertNotReached(); |
189 break; | 190 break; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 */ | 290 */ |
290 onAddAnotherFingerprint_: function() { | 291 onAddAnotherFingerprint_: function() { |
291 this.fire('add-fingerprint'); | 292 this.fire('add-fingerprint'); |
292 this.reset_(); | 293 this.reset_(); |
293 this.$.arc.drawBackgroundCircle(); | 294 this.$.arc.drawBackgroundCircle(); |
294 this.$.arc.drawShadow(10, 0, 0); | 295 this.$.arc.drawShadow(10, 0, 0); |
295 this.browserProxy_.startEnroll(); | 296 this.browserProxy_.startEnroll(); |
296 }, | 297 }, |
297 }); | 298 }); |
298 })(); | 299 })(); |
OLD | NEW |