Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(732)

Unified Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js

Issue 1319093003: Use new earcons in ChromeVox Next. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@automation_node_id_fix_2
Patch Set: Rebase Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
index 0a320962b770b03c24602cd322a0d418f2f899f5..0e2eb115eb7e52d5c8450c001bc7c3ee47c3a89f 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
@@ -13,11 +13,13 @@ goog.provide('global');
goog.require('AutomationPredicate');
goog.require('AutomationUtil');
goog.require('ClassicCompatibility');
+goog.require('NextEarcons');
goog.require('Output');
goog.require('Output.EventType');
goog.require('cursors.Cursor');
goog.require('cvox.BrailleKeyCommand');
goog.require('cvox.ChromeVoxEditableTextBase');
+goog.require('cvox.ClassicEarcons');
goog.require('cvox.ExtensionBridge');
goog.require('cvox.NavBraille');
@@ -115,6 +117,25 @@ Background = function() {
break;
}
}.bind(this));
+
+ /** @type {!cvox.AbstractEarcons} @private */
+ this.classicEarcons_ = cvox.ChromeVox.earcons || new cvox.ClassicEarcons();
+
+ /** @type {!cvox.AbstractEarcons} @private */
+ this.nextEarcons_ = new NextEarcons();
+
+ // Turn cvox.ChromeVox.earcons into a getter that returns either the
+ // Next earcons or the Classic earcons depending on the current mode.
+ Object.defineProperty(cvox.ChromeVox, 'earcons', {
+ get: (function() {
+ if (this.mode_ === ChromeVoxMode.FORCE_NEXT ||
+ this.mode_ === ChromeVoxMode.NEXT) {
+ return this.nextEarcons_;
+ } else {
+ return this.classicEarcons_;
+ }
+ }).bind(this)
+ });
};
Background.prototype = {

Powered by Google App Engine
This is Rietveld 408576698