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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/common/nav_description.js

Issue 1306773003: Make earcon ids strings instead of numbers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_unused_earcons
Patch Set: Fixed 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview A simple container object for the description of a 6 * @fileoverview A simple container object for the description of a
7 * navigation from one object to another. 7 * navigation from one object to another.
8 * 8 *
9 */ 9 */
10 10
11 11
12 goog.provide('cvox.NavDescription'); 12 goog.provide('cvox.NavDescription');
13 13
14 goog.require('cvox.AbstractTts'); 14 goog.require('cvox.AbstractTts');
15 goog.require('cvox.ChromeVox'); 15 goog.require('cvox.ChromeVox');
16 goog.require('cvox.CursorSelection'); 16 goog.require('cvox.CursorSelection');
17 goog.require('cvox.QueueMode'); 17 goog.require('cvox.QueueMode');
18 18
19 /** 19 /**
20 * A class representing the description of navigation from one object to 20 * A class representing the description of navigation from one object to
21 * another. 21 * another.
22 * @param {{context: (undefined|string), 22 * @param {{context: (undefined|string),
23 * text: (string), 23 * text: (string),
24 * userValue: (undefined|string), 24 * userValue: (undefined|string),
25 * annotation: (undefined|string), 25 * annotation: (undefined|string),
26 * earcons: (undefined|Array<number>), 26 * earcons: (undefined|Array<cvox.Earcon>),
27 * personality: (undefined|Object), 27 * personality: (undefined|Object),
28 * hint: (undefined|string), 28 * hint: (undefined|string),
29 category: (undefined|string)}} kwargs The arguments for this 29 category: (undefined|string)}} kwargs The arguments for this
30 * description. 30 * description.
31 * context The context, for example descriptions of objects 31 * context The context, for example descriptions of objects
32 * that were crossed into, like "Toolbar" or "Menu Bar" or "List with 32 * that were crossed into, like "Toolbar" or "Menu Bar" or "List with
33 * 5 items". This is all spoken with an annotation voice. 33 * 5 items". This is all spoken with an annotation voice.
34 * text The text of the object itself, including text from 34 * text The text of the object itself, including text from
35 * titles, labels, etc. 35 * titles, labels, etc.
36 * userValue The text that the user has entered. 36 * userValue The text that the user has entered.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 ' text="' + this.text + '" ' + 74 ' text="' + this.text + '" ' +
75 ' userValue="' + this.userValue + '" ' + 75 ' userValue="' + this.userValue + '" ' +
76 ' annotation="' + this.annotation + 76 ' annotation="' + this.annotation +
77 (this.category ? '" category="' + this.category + '")' : '') + 77 (this.category ? '" category="' + this.category + '")' : '') +
78 '")'; 78 '")';
79 }; 79 };
80 80
81 81
82 /** 82 /**
83 * Modifies the earcon to play along with the spoken description of the object. 83 * Modifies the earcon to play along with the spoken description of the object.
84 * @param {number} earconId An earcon id to be pushed on to the list of earcon 84 * @param {cvox.Earcon} earconId An earcon id to be pushed on to the list of
85 * ids to play along with the spoken description of this object. 85 * earcon ids to play along with the spoken description of this object.
86 */ 86 */
87 cvox.NavDescription.prototype.pushEarcon = function(earconId) { 87 cvox.NavDescription.prototype.pushEarcon = function(earconId) {
88 this.earcons.push(earconId); 88 this.earcons.push(earconId);
89 }; 89 };
90 90
91 91
92 /** 92 /**
93 * Speak this nav description with the given queue mode. 93 * Speak this nav description with the given queue mode.
94 * @param {cvox.QueueMode=} queueMode The queue mode. 94 * @param {cvox.QueueMode=} queueMode The queue mode.
95 * @param {function()=} opt_startCallback Function called when this 95 * @param {function()=} opt_startCallback Function called when this
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 * Compares two NavDescriptions. 154 * Compares two NavDescriptions.
155 * @param {cvox.NavDescription} that A NavDescription. 155 * @param {cvox.NavDescription} that A NavDescription.
156 * @return {boolean} True if equal. 156 * @return {boolean} True if equal.
157 */ 157 */
158 cvox.NavDescription.prototype.equals = function(that) { 158 cvox.NavDescription.prototype.equals = function(that) {
159 return this.context == that.context && 159 return this.context == that.context &&
160 this.text == that.text && 160 this.text == that.text &&
161 this.userValue == that.userValue && 161 this.userValue == that.userValue &&
162 this.annotation == that.annotation; 162 this.annotation == that.annotation;
163 }; 163 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698