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

Unified Diff: chrome/browser/resources/settings/people_page/setup_pin_dialog.js

Issue 2441043004: Accessibility fixes for quick unlock settings. (Closed)
Patch Set: Initial patch Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/people_page/setup_pin_dialog.js
diff --git a/chrome/browser/resources/settings/people_page/setup_pin_dialog.js b/chrome/browser/resources/settings/people_page/setup_pin_dialog.js
index 72b68c829117e51f0c2c6f3cd11895926a6be534..c90b8752edae651dceb9505d48dfafa09448cd8d 100644
--- a/chrome/browser/resources/settings/people_page/setup_pin_dialog.js
+++ b/chrome/browser/resources/settings/people_page/setup_pin_dialog.js
@@ -157,10 +157,17 @@ Polymer({
* @param {string} problemClass
*/
showProblem_: function(messageId, problemClass) {
+ var previousMessage = this.problemMessage_;
+
+ // Update problem info.
this.problemMessage_ = this.i18n(messageId);
this.problemClass_ = problemClass;
this.updateStyles();
- },
+
+ // If the problem message has changed, fire an alert.
+ if (previousMessage != this.problemMessage_)
+ this.$.problemDiv.setAttribute('role', 'alert');
+ },
/** @private */
hideProblem_: function() {
@@ -174,8 +181,8 @@ Polymer({
var isPinLongEnough = this.isPinLongEnough_(this.pinKeyboardValue_);
var isWeak = isPinLongEnough && this.isPinWeak_(this.pinKeyboardValue_);
- if (!isPinLongEnough && this.pinKeyboardValue_)
- this.showProblem_('configurePinTooShort', 'error');
+ if (!isPinLongEnough)
+ this.showProblem_('configurePinTooShort', 'warning');
else if (isWeak)
this.showProblem_('configurePinWeakPin', 'warning');
else
@@ -184,14 +191,12 @@ Polymer({
this.enableSubmit_ = isPinLongEnough;
} else {
- var canSubmit = this.canSubmit_();
-
- if (!canSubmit && this.pinKeyboardValue_)
- this.showProblem_('configurePinMismatched', 'error');
- else
+ if (this.canSubmit_())
this.hideProblem_();
+ else
+ this.showProblem_('configurePinMismatched', 'warning');
- this.enableSubmit_ = canSubmit;
+ this.enableSubmit_ = true;
tommycli 2016/10/25 18:13:50 Should we rename canSubmit? Since that means somet
jdufault 2016/10/26 22:38:36 Renamed to isPinConfirmed_.
tommycli 2016/10/27 00:13:25 Hey I'm still not sure what isPinConfirmed_ means.
jdufault 2016/10/27 19:22:08 Done; I've updated the comment.
}
},
@@ -208,8 +213,10 @@ Polymer({
} else {
// onPinSubmit_ gets called if the user hits enter on the PIN keyboard.
// The PIN is not guaranteed to be valid in that case.
- if (!this.canSubmit_())
+ if (!this.canSubmit_()) {
+ this.showProblem_('configurePinMismatched', 'error');
return;
+ }
function onSetModesCompleted(didSet) {
if (!didSet) {

Powered by Google App Engine
This is Rietveld 408576698