summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkcarattini <kcarattini@chromium.org>2015-01-09 03:34:23 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-09 11:35:12 +0000
commitc2316f07f8164e05decd7f69cbfd30e9ec522594 (patch)
tree1b4462f23f48c8ef8ee8447b3056ba86e6f198e6
parentda69cd0f7c2f92640b7d00e59f66eb3b9fabba2e (diff)
downloadchromium_src-c2316f07f8164e05decd7f69cbfd30e9ec522594.zip
chromium_src-c2316f07f8164e05decd7f69cbfd30e9ec522594.tar.gz
chromium_src-c2316f07f8164e05decd7f69cbfd30e9ec522594.tar.bz2
Hotword: Fix the order in which screen readers will read the error alerts and retry buttons
BUG=445396 Review URL: https://codereview.chromium.org/842083004 Cr-Commit-Position: refs/heads/master@{#310756}
-rw-r--r--chrome/browser/resources/hotword_audio_verification/flow.js20
1 files changed, 16 insertions, 4 deletions
diff --git a/chrome/browser/resources/hotword_audio_verification/flow.js b/chrome/browser/resources/hotword_audio_verification/flow.js
index 1fbb14e..8a76326 100644
--- a/chrome/browser/resources/hotword_audio_verification/flow.js
+++ b/chrome/browser/resources/hotword_audio_verification/flow.js
@@ -210,7 +210,11 @@
$('audio-history-wait').hidden = true;
$('audio-history-error').hidden = false;
- $('audio-history-agree').focus();
+ // Set a timeout before focusing the Enable button so that screenreaders
+ // have time to announce the error first.
+ this.setTimeout_(function() {
+ $('audio-history-agree').focus();
+ }.bind(this), 50);
};
/**
@@ -441,7 +445,12 @@
curStep.classList.remove('listening');
curStep.classList.add('not-started');
}
- $(this.trainingPagePrefix_ + '-toast').children[1].focus();
+
+ // Set a timeout before focusing the Retry button so that screenreaders
+ // have time to announce the timeout first.
+ this.setTimeout_(function() {
+ $(this.trainingPagePrefix_ + '-toast').children[1].focus();
+ }.bind(this), 50);
} else if (this.trainingState_ == TrainingState.ERROR) {
// Update the buttonbar.
$(this.trainingPagePrefix_ + '-wait').hidden = true;
@@ -449,8 +458,11 @@
$(this.trainingPagePrefix_ + '-retry').hidden = false;
$(this.trainingPagePrefix_ + '-processing').hidden = false;
- // Focus the retry button.
- $(this.trainingPagePrefix_ + '-retry').children[0].focus();
+ // Set a timeout before focusing the Retry button so that screenreaders
+ // have time to announce the error first.
+ this.setTimeout_(function() {
+ $(this.trainingPagePrefix_ + '-retry').children[0].focus();
+ }.bind(this), 50);
}
};