Commit 3f8d8241 authored by Martin Kreichgauer's avatar Martin Kreichgauer Committed by Commit Bot

settings UI: security key accessibility fixes

This makes the following improvements to the security key settings UI subpage:
1) Label the "PIN" text field in the "Manage sign-in data" and "Enroll
  fingerprints" dialogs.
2) Add IronA11yAnnouncer support to settings-security-keys-pin-field
  PIN validation errors.
3) Disable credential management confirm buttons in between asynchronous
  operations.

Bug: 955859
Change-Id: Ie05a237fe24d43a71bc24a89eb9a03d168b349cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1808298
Commit-Queue: Martin Kreichgauer <martinkr@google.com>
Reviewed-by: default avatarDan Beam <dbeam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697272}
parent 4b07bcbe
...@@ -51,7 +51,8 @@ ...@@ -51,7 +51,8 @@
<div id="pinPrompt"> <div id="pinPrompt">
<p>$i18n{securityKeysBioEnrollmentPinPrompt}</p> <p>$i18n{securityKeysBioEnrollmentPinPrompt}</p>
<settings-security-keys-pin-field id="pin"> <settings-security-keys-pin-field
id="pin" label="$i18n{securityKeysPIN}">
</settings-security-keys-pin-field> </settings-security-keys-pin-field>
</div> </div>
......
...@@ -69,7 +69,8 @@ ...@@ -69,7 +69,8 @@
<div id="pinPrompt"> <div id="pinPrompt">
<p>$i18nRaw{securityKeysCredentialManagementPinPrompt}</p> <p>$i18nRaw{securityKeysCredentialManagementPinPrompt}</p>
<settings-security-keys-pin-field id="pin"> <settings-security-keys-pin-field
id="pin" label="$i18n{securityKeysPIN}">
</settings-security-keys-pin-field> </settings-security-keys-pin-field>
</div> </div>
...@@ -92,9 +93,9 @@ ...@@ -92,9 +93,9 @@
</div> </div>
<div class="user">[[formatUser_(item)]]</div> <div class="user">[[formatUser_(item)]]</div>
<cr-checkbox on-change="checkedCredentialsChanged_" <cr-checkbox on-change="checkedCredentialsChanged_"
data-id$="[[item.id]]" data-id$="[[item.id]]"
checked="[[credentialIsChecked_(item.id)]]" checked="[[credentialIsChecked_(item.id)]]"
disabled="[[deleteInProgress_]]"></cr-checkbox> disabled="[[deleteInProgress_]]"></cr-checkbox>
</div> </div>
</template> </template>
</iron-list> </iron-list>
......
...@@ -98,7 +98,9 @@ Polymer({ ...@@ -98,7 +98,9 @@ Polymer({
if (!this.$.pin.validate()) { if (!this.$.pin.validate()) {
return; return;
} }
this.confirmButtonDisabled_ = true;
this.browserProxy_.providePIN(this.$.pin.value).then((retries) => { this.browserProxy_.providePIN(this.$.pin.value).then((retries) => {
this.confirmButtonDisabled_ = false;
if (retries != null) { if (retries != null) {
this.$.pin.showIncorrectPINError(retries); this.$.pin.showIncorrectPINError(retries);
this.collectPin_(); this.collectPin_();
...@@ -258,9 +260,11 @@ Polymer({ ...@@ -258,9 +260,11 @@ Polymer({
assert(this.credentials_ && this.credentials_.length > 0); assert(this.credentials_ && this.credentials_.length > 0);
assert(this.checkedCredentialIds_.size > 0); assert(this.checkedCredentialIds_.size > 0);
this.confirmButtonDisabled_ = true;
this.deleteInProgress_ = true; this.deleteInProgress_ = true;
this.browserProxy_.deleteCredentials(Array.from(this.checkedCredentialIds_)) this.browserProxy_.deleteCredentials(Array.from(this.checkedCredentialIds_))
.then((err) => { .then((err) => {
this.confirmButtonDisabled_ = false;
this.deleteInProgress_ = false; this.deleteInProgress_ = false;
this.onError_(err); this.onError_(err);
}); });
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<link rel="import" href="chrome://resources/html/i18n_behavior.html"> <link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html"> <link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
<link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html"> <link rel="import" href="chrome://resources/cr_elements/cr_icon_button/cr_icon_button.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-a11y-announcer/iron-a11y-announcer.html">
<link rel="import" href="../i18n_setup.html"> <link rel="import" href="../i18n_setup.html">
<link rel="import" href="../settings_shared_css.html"> <link rel="import" href="../settings_shared_css.html">
......
...@@ -18,7 +18,10 @@ Polymer({ ...@@ -18,7 +18,10 @@ Polymer({
label: String, label: String,
/** The validation error label of the input field. */ /** The validation error label of the input field. */
error: String, error: {
type: String,
observer: 'errorChanged_',
},
/** The value of the input field. */ /** The value of the input field. */
value: String, value: String,
...@@ -32,6 +35,10 @@ Polymer({ ...@@ -32,6 +35,10 @@ Polymer({
/** @override */ /** @override */
attached: function() { attached: function() {
Polymer.RenderStatus.afterNextRender(this, function() {
Polymer.IronA11yAnnouncer.requestAvailability();
});
this.inputVisible_ = false; this.inputVisible_ = false;
}, },
...@@ -158,4 +165,11 @@ Polymer({ ...@@ -158,4 +165,11 @@ Polymer({
return ''; return '';
}, },
/** @private */
errorChanged_: function() {
// Make screen readers announce changes to the PIN validation error
// label.
this.fire('iron-announce', {text: this.error});
},
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment