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

Unified Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/next_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: Address feedback, add test 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/next_earcons.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/next_earcons.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/next_earcons.js
new file mode 100644
index 0000000000000000000000000000000000000000..314b1157d4197d4e8278dec26b774d8064666f5a
--- /dev/null
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/next_earcons.js
@@ -0,0 +1,116 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @fileoverview Earcons library that uses EarconEngine to play back
+ * auditory cues.
+ *
+ */
+
+
+goog.provide('NextEarcons');
+
+goog.require('EarconEngine');
+goog.require('cvox.AbstractEarcons');
+
+
+/**
+ * @constructor
+ * @extends {cvox.AbstractEarcons}
+ */
+NextEarcons = function() {
+ cvox.AbstractEarcons.call(this);
+
+ /**
+ * The ChromeVox Next earcon engine.
+ * @type {EarconEngine}
+ * @private
+ */
+ this.engine_ = new EarconEngine();
+};
+
+
+/**
+ * @return {string} The human-readable name of the earcon set.
+ */
+NextEarcons.prototype.getName = function() {
Peter Lundblad 2015/09/24 14:56:27 Why not the object literal assigning to the protot
dmazzoni 2015/09/28 16:33:05 Done.
+ return 'ChromeVox Next earcons';
+};
+
+
+/**
+ * @override
+ */
+NextEarcons.prototype.playEarcon = function(earcon) {
+ if (!this.enabled) {
+ return;
+ }
+ if (window['console']) {
Peter Lundblad 2015/09/24 14:56:27 What environment do you anticipate this running in
dmazzoni 2015/09/28 16:33:05 Lol, I just inherited this from the other file. Ma
+ window['console']['log']('Earcon ' + earcon);
+ }
+
+ switch (earcon) {
+ case cvox.Earcon.ALERT_MODAL:
+ case cvox.Earcon.ALERT_NONMODAL:
+ this.engine_.onAlert();
+ break;
+ case cvox.Earcon.BUTTON:
+ this.engine_.onButton();
+ break;
+ case cvox.Earcon.CHECK_OFF:
+ this.engine_.onCheckOff();
+ break;
+ case cvox.Earcon.CHECK_ON:
+ this.engine_.onCheckOn();
+ break;
+ case cvox.Earcon.EDITABLE_TEXT:
+ this.engine_.onTextField();
+ break;
+ case cvox.Earcon.INVALID_KEYPRESS:
+ break;
+ case cvox.Earcon.LINK:
+ this.engine_.onLink();
+ break;
+ case cvox.Earcon.LISTBOX:
+ this.engine_.onSelect();
+ break;
+ case cvox.Earcon.LIST_ITEM:
+ case cvox.Earcon.LONG_DESC:
+ case cvox.Earcon.MATH:
+ case cvox.Earcon.OBJECT_CLOSE:
+ case cvox.Earcon.OBJECT_ENTER:
+ case cvox.Earcon.OBJECT_EXIT:
+ case cvox.Earcon.OBJECT_OPEN:
+ case cvox.Earcon.OBJECT_SELECT:
+ break;
+ case cvox.Earcon.PAGE_FINISH_LOADING:
+ this.engine_.cancelProgress();
+ break;
+ case cvox.Earcon.PAGE_START_LOADING:
+ // TODO(dmazzoni): only when the page has focus.
+ this.engine_.startProgress();
+ break;
+ case cvox.Earcon.POP_UP_BUTTON:
+ this.engine_.onPopUpButton();
+ break;
+ case cvox.Earcon.RECOVER_FOCUS:
+ break;
+ case cvox.Earcon.SELECTION:
+ this.engine_.onSelection();
+ break;
+ case cvox.Earcon.SELECTION_REVERSE:
+ this.engine_.onSelectionReverse();
+ break;
+ case cvox.Earcon.SKIP:
+ this.engine_.onSkim();
+ break;
+ case cvox.Earcon.SLIDER:
+ this.engine_.onSlider();
+ break;
+ case cvox.Earcon.WRAP:
+ case cvox.Earcon.WRAP_EDGE:
+ this.engine_.onWrap();
+ break;
+ }
+};

Powered by Google App Engine
This is Rietveld 408576698