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'); ...@@ -15,32 +15,34 @@ goog.require('BackgroundKeyboardHandler');
goog.require('BackgroundMouseHandler'); goog.require('BackgroundMouseHandler');
goog.require('BrailleCommandData'); goog.require('BrailleCommandData');
goog.require('BrailleCommandHandler'); goog.require('BrailleCommandHandler');
goog.require('BrailleKeyCommand');
goog.require('ChromeVoxBackground');
goog.require('ChromeVoxEditableTextBase');
goog.require('ChromeVoxState'); goog.require('ChromeVoxState');
goog.require('CommandHandler'); goog.require('CommandHandler');
goog.require('DesktopAutomationHandler'); goog.require('DesktopAutomationHandler');
goog.require('DownloadHandler'); goog.require('DownloadHandler');
goog.require('ExtensionBridge');
goog.require('FindHandler'); goog.require('FindHandler');
goog.require('FocusAutomationHandler');
goog.require('GestureCommandHandler'); goog.require('GestureCommandHandler');
goog.require('LiveRegions'); goog.require('LiveRegions');
goog.require('LocaleOutputHelper');
goog.require('MathHandler'); goog.require('MathHandler');
goog.require('MediaAutomationHandler'); goog.require('MediaAutomationHandler');
goog.require('NavBraille');
goog.require('NextEarcons'); goog.require('NextEarcons');
goog.require('NodeIdentifier');
goog.require('Notifications'); goog.require('Notifications');
goog.require('Output'); goog.require('Output');
goog.require('Output.EventType'); goog.require('Output.EventType');
goog.require('PanelCommand'); goog.require('PanelCommand');
goog.require('PhoneticData'); goog.require('PhoneticData');
goog.require('FocusAutomationHandler');
goog.require('RangeAutomationHandler'); goog.require('RangeAutomationHandler');
goog.require('UserAnnotationHandler');
goog.require('constants'); goog.require('constants');
goog.require('cursors.Cursor'); 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() { goog.scope(function() {
const AutomationNode = chrome.automation.AutomationNode; const AutomationNode = chrome.automation.AutomationNode;
...@@ -58,6 +60,7 @@ Background = class extends ChromeVoxState { ...@@ -58,6 +60,7 @@ Background = class extends ChromeVoxState {
// Initialize legacy background page first. // Initialize legacy background page first.
ChromeVoxBackground.init(); ChromeVoxBackground.init();
LocaleOutputHelper.init();
/** /**
* A list of site substring patterns to use with ChromeVox next. Keep these * A list of site substring patterns to use with ChromeVox next. Keep these
......
...@@ -12,8 +12,6 @@ ...@@ -12,8 +12,6 @@
goog.provide('LocaleOutputHelper'); goog.provide('LocaleOutputHelper');
goog.require('StringUtil');
LocaleOutputHelper = class { LocaleOutputHelper = class {
/** @private */ /** @private */
constructor() { constructor() {
...@@ -141,26 +139,14 @@ LocaleOutputHelper = class { ...@@ -141,26 +139,14 @@ LocaleOutputHelper = class {
/** /**
* Creates a singleton instance of LocaleOutputHelper. * Creates a singleton instance of LocaleOutputHelper.
* @private
*/ */
static init() { static init() {
if (LocaleOutputHelper.instance_ !== undefined) { if (LocaleOutputHelper.instance !== undefined) {
console.error( throw new Error(
'LocaleOutputHelper is a singleton, can only call |init| once'); 'LocaleOutputHelper is a singleton, can only initialize once');
return;
} }
LocaleOutputHelper.instance_ = new LocaleOutputHelper(); LocaleOutputHelper.instance = new LocaleOutputHelper();
}
/**
* @return {!LocaleOutputHelper}
*/
static get instance() {
if (!LocaleOutputHelper.instance_) {
LocaleOutputHelper.init();
}
return LocaleOutputHelper.instance_;
} }
/** /**
......
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