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

Unified Diff: chrome/browser/resources/chromeos/chromevox/host/interface/abstract_earcons.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: Init in AbstractEarcons instead 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/host/interface/abstract_earcons.js
diff --git a/chrome/browser/resources/chromeos/chromevox/host/interface/abstract_earcons.js b/chrome/browser/resources/chromeos/chromevox/host/interface/abstract_earcons.js
index 1dabd1ad6d461aea3f81f0a732af57caf8869229..0f334fc9e43508d08521d251644b9ea341cfd32e 100644
--- a/chrome/browser/resources/chromeos/chromevox/host/interface/abstract_earcons.js
+++ b/chrome/browser/resources/chromeos/chromevox/host/interface/abstract_earcons.js
@@ -37,10 +37,12 @@ cvox.Earcon = {
OBJECT_SELECT: 'object_select',
PAGE_FINISH_LOADING: 'page_finish_loading',
PAGE_START_LOADING: 'page_start_loading',
+ POP_UP_BUTTON: 'pop_up_button',
RECOVER_FOCUS: 'recover_focus',
SELECTION: 'selection',
SELECTION_REVERSE: 'selection_reverse',
SKIP: 'skip',
+ SLIDER: 'slider',
WRAP: 'wrap',
WRAP_EDGE: 'wrap_edge',
};
@@ -50,16 +52,21 @@ cvox.Earcon = {
* @constructor
*/
cvox.AbstractEarcons = function() {
- /**
- * Public flag set to enable or disable earcons. Callers should prefer
- * toggle(); however, this member is public for initialization.
- * @type {boolean}
- */
- this.enabled = true;
+ if (localStorage['earcons'] === 'false') {
Peter Lundblad 2015/10/14 12:27:26 If we're running in the content script, what local
dmazzoni 2015/10/14 16:13:28 It appears to be shared. To be safe I moved this
+ cvox.AbstractEarcons.enabled = false;
+ }
};
/**
+ * Public static flag set to enable or disable earcons. Callers should prefer
+ * toggle(); however, this member is public for initialization.
+ * @type {boolean}
+ */
+cvox.AbstractEarcons.enabled = true;
+
+
+/**
* Plays the specified earcon sound.
* @param {cvox.Earcon} earcon An earcon identifier.
*/
@@ -81,6 +88,6 @@ cvox.AbstractEarcons.prototype.earconsAvailable = function() {
* @return {boolean} True if earcons are now enabled; false otherwise.
*/
cvox.AbstractEarcons.prototype.toggle = function() {
Peter Lundblad 2015/10/14 12:27:26 I find it slightly unexpected to have an instance
dmazzoni 2015/10/14 16:13:28 The content script extends it, though - it sends t
- this.enabled = !this.enabled;
- return this.enabled;
+ cvox.AbstractEarcons.enabled = !cvox.AbstractEarcons.enabled;
+ return cvox.AbstractEarcons.enabled;
};

Powered by Google App Engine
This is Rietveld 408576698