Commit e54ceb29 authored by Katie D's avatar Katie D Committed by Commit Bot

Always continue speaking after text goes away in STS.

This mostly reverts the commit, "Adds user setting to allow speech to
continue after text goes away." (commit 80d1057b)

However, the private variable readAfterClose_ was kept in order to by default
keep reading, but make it easy to change this functionality later.

After UI review, it was determined that the setting is unnecessary. We will just
always speak after text goes away. This may be confusing for novice users but
should get better once we have the on-screen UI.

Bug: 818835
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I04a36b717251ef88283570a690e42366c035dded
Reviewed-on: https://chromium-review.googlesource.com/967241Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Katie Dektar <katie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544094}
parent 4a15dd66
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
'<(EXTERNS_GYP):accessibility_private', '<(EXTERNS_GYP):accessibility_private',
'<(EXTERNS_GYP):automation', '<(EXTERNS_GYP):automation',
'<(EXTERNS_GYP):chrome_extensions', '<(EXTERNS_GYP):chrome_extensions',
'<(EXTERNS_GYP):command_line_private',
'<(EXTERNS_GYP):metrics_private', '<(EXTERNS_GYP):metrics_private',
], ],
'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'], 'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
......
...@@ -99,17 +99,6 @@ ...@@ -99,17 +99,6 @@
</div> </div>
</div> </div>
</div> </div>
<div id="behavior">
<h2 class="i18n" msgid="options_behavior"></h2>
<div class="option">
<input id="readAfterClose" type="checkbox" class="checkbox pref"
name="readAfterClose" aria-labeledby="readAfterCloseLabel">
<label id="readAfterCloseLabel" class="i18n"
msgid="options_read_after_close">
</label>
</div>
</div>
</div> </div>
<script src="select_to_speak_options.js"></script> <script src="select_to_speak_options.js"></script>
......
...@@ -116,7 +116,7 @@ var SelectToSpeak = function() { ...@@ -116,7 +116,7 @@ var SelectToSpeak = function() {
this.highlightColor_ = '#5e9bff'; this.highlightColor_ = '#5e9bff';
/** @private {boolean} */ /** @private {boolean} */
this.readAfterClose_ = false; this.readAfterClose_ = true;
/** @private {?NodeGroupItem} */ /** @private {?NodeGroupItem} */
this.currentNode_ = null; this.currentNode_ = null;
...@@ -882,10 +882,7 @@ SelectToSpeak.prototype = { ...@@ -882,10 +882,7 @@ SelectToSpeak.prototype = {
var updatePrefs = var updatePrefs =
(function() { (function() {
chrome.storage.sync.get( chrome.storage.sync.get(
[ ['voice', 'rate', 'pitch', 'wordHighlight', 'highlightColor'],
'voice', 'rate', 'pitch', 'wordHighlight', 'highlightColor',
'readAfterClose'
],
(function(prefs) { (function(prefs) {
if (prefs['voice']) { if (prefs['voice']) {
this.voiceNameFromPrefs_ = prefs['voice']; this.voiceNameFromPrefs_ = prefs['voice'];
...@@ -912,12 +909,6 @@ SelectToSpeak.prototype = { ...@@ -912,12 +909,6 @@ SelectToSpeak.prototype = {
chrome.storage.sync.set( chrome.storage.sync.set(
{'highlightColor': this.highlightColor_}); {'highlightColor': this.highlightColor_});
} }
if (prefs['readAfterClose'] !== undefined) {
this.readAfterClose_ = prefs['readAfterClose'];
} else {
chrome.storage.sync.set(
{'readAfterClose': this.readAfterClose_});
}
}).bind(this)); }).bind(this));
}).bind(this); }).bind(this);
...@@ -989,8 +980,8 @@ SelectToSpeak.prototype = { ...@@ -989,8 +980,8 @@ SelectToSpeak.prototype = {
updateFromNodeState_: function(nodeGroupItem, inForeground) { updateFromNodeState_: function(nodeGroupItem, inForeground) {
switch (getNodeState(nodeGroupItem.node)) { switch (getNodeState(nodeGroupItem.node)) {
case NodeState.NODE_STATE_INVALID: case NodeState.NODE_STATE_INVALID:
// If the node is invalid, stop speaking entirely if the user setting // If the node is invalid, continue speech unless readAfterClose_
// is not to continue reading. // is set to true. See https://crbug.com/818835 for more.
if (this.readAfterClose_) { if (this.readAfterClose_) {
this.clearFocusRing_(); this.clearFocusRing_();
this.visible_ = false; this.visible_ = false;
......
...@@ -37,13 +37,6 @@ SelectToSpeakOptionsPage.prototype = { ...@@ -37,13 +37,6 @@ SelectToSpeakOptionsPage.prototype = {
select.disabled = true; select.disabled = true;
} }
}); });
this.syncCheckboxControlToPref_('readAfterClose', 'readAfterClose');
chrome.commandLinePrivate.hasSwitch(
'enable-experimental-accessibility-features',
(experimentalFeaturesEnabled) => {
let behaviorSection = document.getElementById('behavior');
behaviorSection.hidden = !experimentalFeaturesEnabled;
});
this.setUpHighlightListener_(); this.setUpHighlightListener_();
chrome.metricsPrivate.recordUserAction( chrome.metricsPrivate.recordUserAction(
'Accessibility.CrosSelectToSpeak.LoadSettings'); 'Accessibility.CrosSelectToSpeak.LoadSettings');
......
...@@ -192,12 +192,6 @@ ...@@ -192,12 +192,6 @@
<message desc="Label for highest synthesized speech pitch in the Select-to-speak options dialog." name="IDS_SELECT_TO_SPEAK_OPTIONS_PITCH_HIGHEST"> <message desc="Label for highest synthesized speech pitch in the Select-to-speak options dialog." name="IDS_SELECT_TO_SPEAK_OPTIONS_PITCH_HIGHEST">
Highest Highest
</message> </message>
<message desc="Group of options for controlling behavior" name="IDS_SELECT_TO_SPEAK_OPTIONS_BEHAVIOR">
Behavior
</message>
<message desc="Label for option to continue reading after text goes away, or stop when text goes away" name="IDS_SELECT_TO_SPEAK_OPTIONS_READ_AFTER_CLOSE">
Continue reading if text being spoken goes away
</message>
</messages> </messages>
</release> </release>
</grit> </grit>
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