Commit e2a65c61 authored by Akihiro Ota's avatar Akihiro Ota Committed by Commit Bot

ChromeVox: Fix 'No voice for <language>' message upon startup.

(repros 0/10 times).
was available for system language (at startup).

Bug: 1086640
Test: Manually verify by running ChromeVox startup 10 times
Change-Id: I8c735a58e6c943916792430bb96e6b2ccf3eeb88
AX-Relnotes: Fix voice switching issue where ChromeVox said no voice
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2216379
Commit-Queue: Akihiro Ota <akihiroota@chromium.org>
Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772713}
parent 097e31e7
......@@ -15,32 +15,34 @@ goog.require('BackgroundKeyboardHandler');
goog.require('BackgroundMouseHandler');
goog.require('BrailleCommandData');
goog.require('BrailleCommandHandler');
goog.require('BrailleKeyCommand');
goog.require('ChromeVoxBackground');
goog.require('ChromeVoxEditableTextBase');
goog.require('ChromeVoxState');
goog.require('CommandHandler');
goog.require('DesktopAutomationHandler');
goog.require('DownloadHandler');
goog.require('ExtensionBridge');
goog.require('FindHandler');
goog.require('FocusAutomationHandler');
goog.require('GestureCommandHandler');
goog.require('LiveRegions');
goog.require('LocaleOutputHelper');
goog.require('MathHandler');
goog.require('MediaAutomationHandler');
goog.require('NavBraille');
goog.require('NextEarcons');
goog.require('NodeIdentifier');
goog.require('Notifications');
goog.require('Output');
goog.require('Output.EventType');
goog.require('PanelCommand');
goog.require('PhoneticData');
goog.require('FocusAutomationHandler');
goog.require('RangeAutomationHandler');
goog.require('UserAnnotationHandler');
goog.require('constants');
goog.require('cursors.Cursor');
goog.require('BrailleKeyCommand');
goog.require('ChromeVoxBackground');
goog.require('ChromeVoxEditableTextBase');
goog.require('ExtensionBridge');
goog.require('NavBraille');
goog.require('NodeIdentifier');
goog.require('UserAnnotationHandler');
goog.scope(function() {
const AutomationNode = chrome.automation.AutomationNode;
......@@ -58,6 +60,7 @@ Background = class extends ChromeVoxState {
// Initialize legacy background page first.
ChromeVoxBackground.init();
LocaleOutputHelper.init();
/**
* A list of site substring patterns to use with ChromeVox next. Keep these
......
......@@ -12,8 +12,6 @@
goog.provide('LocaleOutputHelper');
goog.require('StringUtil');
LocaleOutputHelper = class {
/** @private */
constructor() {
......@@ -141,26 +139,14 @@ LocaleOutputHelper = class {
/**
* Creates a singleton instance of LocaleOutputHelper.
* @private
*/
static init() {
if (LocaleOutputHelper.instance_ !== undefined) {
console.error(
'LocaleOutputHelper is a singleton, can only call |init| once');
return;
if (LocaleOutputHelper.instance !== undefined) {
throw new Error(
'LocaleOutputHelper is a singleton, can only initialize once');
}
LocaleOutputHelper.instance_ = new LocaleOutputHelper();
}
/**
* @return {!LocaleOutputHelper}
*/
static get instance() {
if (!LocaleOutputHelper.instance_) {
LocaleOutputHelper.init();
}
return LocaleOutputHelper.instance_;
LocaleOutputHelper.instance = new LocaleOutputHelper();
}
/**
......
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