Index: chrome/browser/resources/chromeos/chromevox/chromevox/background/background.js |
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/background/background.js b/chrome/browser/resources/chromeos/chromevox/chromevox/background/background.js |
index 1f07264886195797cdf01d585b2a7bcb5e69dbb9..9393c4ad33bd1f0b05bf3011aeb6baabcec1d695 100644 |
--- a/chrome/browser/resources/chromeos/chromevox/chromevox/background/background.js |
+++ b/chrome/browser/resources/chromeos/chromevox/chromevox/background/background.js |
@@ -8,6 +8,7 @@ |
goog.provide('cvox.ChromeVoxBackground'); |
+goog.require('Msgs'); |
goog.require('cvox.AbstractEarcons'); |
goog.require('cvox.BrailleBackground'); |
goog.require('cvox.BrailleCaptionsBackground'); |
@@ -20,7 +21,6 @@ goog.require('cvox.EarconsBackground'); |
goog.require('cvox.ExtensionBridge'); |
goog.require('cvox.HostFactory'); |
goog.require('cvox.InjectedScriptLoader'); |
-goog.require('cvox.Msgs'); |
goog.require('cvox.NavBraille'); |
// TODO(dtseng): This is required to prevent Closure from stripping our export |
// prefs on window. |
@@ -55,7 +55,6 @@ cvox.ChromeVoxBackground.prototype.init = function() { |
return; |
} |
- cvox.ChromeVox.msgs = new cvox.Msgs(); |
this.prefs = new cvox.ChromeVoxPrefs(); |
this.readPrefs(); |
@@ -127,14 +126,14 @@ cvox.ChromeVoxBackground.prototype.init = function() { |
if (localStorage['active'] == 'false') { |
// Warn the user when the browser first starts if ChromeVox is inactive. |
- this.tts.speak(cvox.ChromeVox.msgs.getMsg('chromevox_inactive'), |
+ this.tts.speak(Msgs.getMsg('chromevox_inactive'), |
cvox.QueueMode.QUEUE); |
} else if (cvox.PlatformUtil.matchesPlatform(cvox.PlatformFilter.WML)) { |
// Introductory message. |
- this.tts.speak(cvox.ChromeVox.msgs.getMsg('chromevox_intro'), |
+ this.tts.speak(Msgs.getMsg('chromevox_intro'), |
cvox.QueueMode.QUEUE); |
cvox.ChromeVox.braille.write(cvox.NavBraille.fromText( |
- cvox.ChromeVox.msgs.getMsg('intro_brl'))); |
+ Msgs.getMsg('intro_brl'))); |
} |
}; |
@@ -234,15 +233,15 @@ cvox.ChromeVoxBackground.prototype.onTtsMessage = function(msg) { |
var announcement; |
switch (msg['property']) { |
case cvox.AbstractTts.RATE: |
- announcement = cvox.ChromeVox.msgs.getMsg('announce_rate', |
+ announcement = Msgs.getMsg('announce_rate', |
[valueAsPercent]); |
break; |
case cvox.AbstractTts.PITCH: |
- announcement = cvox.ChromeVox.msgs.getMsg('announce_pitch', |
+ announcement = Msgs.getMsg('announce_pitch', |
[valueAsPercent]); |
break; |
case cvox.AbstractTts.VOLUME: |
- announcement = cvox.ChromeVox.msgs.getMsg('announce_volume', |
+ announcement = Msgs.getMsg('announce_volume', |
[valueAsPercent]); |
break; |
} |
@@ -252,7 +251,7 @@ cvox.ChromeVoxBackground.prototype.onTtsMessage = function(msg) { |
cvox.AbstractTts.PERSONALITY_ANNOTATION); |
} |
} else if (msg['action'] == 'cyclePunctuationEcho') { |
- this.tts.speak(cvox.ChromeVox.msgs.getMsg( |
+ this.tts.speak(Msgs.getMsg( |
this.backgroundTts_.cyclePunctuationEcho()), |
cvox.QueueMode.FLUSH); |
} |
@@ -320,7 +319,7 @@ cvox.ChromeVoxBackground.prototype.addBridgeListener = function() { |
if (msg['pref'] == 'active' && |
msg['value'] != cvox.ChromeVox.isActive) { |
if (cvox.ChromeVox.isActive) { |
- this.tts.speak(cvox.ChromeVox.msgs.getMsg('chromevox_inactive'), |
+ this.tts.speak(Msgs.getMsg('chromevox_inactive'), |
cvox.QueueMode.FLUSH); |
chrome.accessibilityPrivate.setNativeAccessibilityEnabled( |
true); |
@@ -332,27 +331,27 @@ cvox.ChromeVoxBackground.prototype.addBridgeListener = function() { |
this.earcons.enabled = msg['value']; |
} else if (msg['pref'] == 'sticky' && msg['announce']) { |
if (msg['value']) { |
- this.tts.speak(cvox.ChromeVox.msgs.getMsg('sticky_mode_enabled'), |
+ this.tts.speak(Msgs.getMsg('sticky_mode_enabled'), |
cvox.QueueMode.QUEUE); |
} else { |
this.tts.speak( |
- cvox.ChromeVox.msgs.getMsg('sticky_mode_disabled'), |
+ Msgs.getMsg('sticky_mode_disabled'), |
cvox.QueueMode.QUEUE); |
} |
} else if (msg['pref'] == 'typingEcho' && msg['announce']) { |
var announce = ''; |
switch (msg['value']) { |
case cvox.TypingEcho.CHARACTER: |
- announce = cvox.ChromeVox.msgs.getMsg('character_echo'); |
+ announce = Msgs.getMsg('character_echo'); |
break; |
case cvox.TypingEcho.WORD: |
- announce = cvox.ChromeVox.msgs.getMsg('word_echo'); |
+ announce = Msgs.getMsg('word_echo'); |
break; |
case cvox.TypingEcho.CHARACTER_AND_WORD: |
- announce = cvox.ChromeVox.msgs.getMsg('character_and_word_echo'); |
+ announce = Msgs.getMsg('character_and_word_echo'); |
break; |
case cvox.TypingEcho.NONE: |
- announce = cvox.ChromeVox.msgs.getMsg('none_echo'); |
+ announce = Msgs.getMsg('none_echo'); |
break; |
default: |
break; |
@@ -444,11 +443,11 @@ cvox.ChromeVoxBackground.prototype.isIncognito_ = function() { |
* Handles the onIntroduceChromeVox event. |
*/ |
cvox.ChromeVoxBackground.prototype.onIntroduceChromeVox = function() { |
- cvox.ChromeVox.tts.speak(cvox.ChromeVox.msgs.getMsg('chromevox_intro'), |
+ cvox.ChromeVox.tts.speak(Msgs.getMsg('chromevox_intro'), |
cvox.QueueMode.QUEUE, |
{doNotInterrupt: true}); |
cvox.ChromeVox.braille.write(cvox.NavBraille.fromText( |
- cvox.ChromeVox.msgs.getMsg('intro_brl'))); |
+ Msgs.getMsg('intro_brl'))); |
}; |