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

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: Update test expectations Created 5 years, 3 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 4d268727a98b262132ff8c6efdfb5b864c8fb450..bbd8ca943ac368373319be4bc350e9ff6732faf1 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,14 @@ Background = function() {
break;
}
}.bind(this));
+
+ /** @type {!cvox.AbstractEarcons} @private */
+ this.classicEarcons_ = cvox.ChromeVox.earcons || new cvox.ClassicEarcons();
Peter Lundblad 2015/09/29 09:27:33 This constructor now depends on only being called
dmazzoni 2015/10/13 23:07:03 I believe this isn't an issue anymore. If we const
+
+ /** @type {!cvox.AbstractEarcons} @private */
+ this.nextEarcons_ = new NextEarcons();
+
+ cvox.ChromeVox.earcons = this.classicEarcons_;
};
Background.prototype = {
@@ -735,6 +745,18 @@ Background.prototype = {
}
}.bind(this));
+ // Switch the earcon controller used depending on if we're using
+ // ChromeVox Next or Classic, but don't change it if the earcon
+ // controller is something else (like for testing).
+ if (cvox.ChromeVox.earcons == this.classicEarcons_ ||
+ cvox.ChromeVox.earcons == this.nextEarcons_) {
+ if (mode === ChromeVoxMode.FORCE_NEXT || mode === ChromeVoxMode.NEXT) {
+ cvox.ChromeVox.earcons = this.nextEarcons_;
+ } else {
+ cvox.ChromeVox.earcons = this.classicEarcons_;
+ }
+ }
Peter Lundblad 2015/09/29 09:27:33 I am always cautious when introducing state that i
dmazzoni 2015/10/13 23:07:03 Done, made it a getter.
+
this.mode_ = mode;
},

Powered by Google App Engine
This is Rietveld 408576698