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

Side by Side 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 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 Base class for implementing earcons. 6 * @fileoverview Base class for implementing earcons.
7 * 7 *
8 * When adding earcons, please add them to getEarconName and getEarconId. 8 * When adding earcons, please add them to getEarconName and getEarconId.
9 * 9 *
10 */ 10 */
(...skipping 19 matching lines...) Expand all
30 LIST_ITEM: 'list_item', 30 LIST_ITEM: 'list_item',
31 LONG_DESC: 'long_desc', 31 LONG_DESC: 'long_desc',
32 MATH: 'math', 32 MATH: 'math',
33 OBJECT_CLOSE: 'object_close', 33 OBJECT_CLOSE: 'object_close',
34 OBJECT_ENTER: 'object_enter', 34 OBJECT_ENTER: 'object_enter',
35 OBJECT_EXIT: 'object_exit', 35 OBJECT_EXIT: 'object_exit',
36 OBJECT_OPEN: 'object_open', 36 OBJECT_OPEN: 'object_open',
37 OBJECT_SELECT: 'object_select', 37 OBJECT_SELECT: 'object_select',
38 PAGE_FINISH_LOADING: 'page_finish_loading', 38 PAGE_FINISH_LOADING: 'page_finish_loading',
39 PAGE_START_LOADING: 'page_start_loading', 39 PAGE_START_LOADING: 'page_start_loading',
40 POP_UP_BUTTON: 'pop_up_button',
40 RECOVER_FOCUS: 'recover_focus', 41 RECOVER_FOCUS: 'recover_focus',
41 SELECTION: 'selection', 42 SELECTION: 'selection',
42 SELECTION_REVERSE: 'selection_reverse', 43 SELECTION_REVERSE: 'selection_reverse',
43 SKIP: 'skip', 44 SKIP: 'skip',
45 SLIDER: 'slider',
44 WRAP: 'wrap', 46 WRAP: 'wrap',
45 WRAP_EDGE: 'wrap_edge', 47 WRAP_EDGE: 'wrap_edge',
46 }; 48 };
47 49
48 50
49 /** 51 /**
50 * @constructor 52 * @constructor
51 */ 53 */
52 cvox.AbstractEarcons = function() { 54 cvox.AbstractEarcons = function() {
53 /** 55 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
54 * Public flag set to enable or disable earcons. Callers should prefer 56 cvox.AbstractEarcons.enabled = false;
55 * toggle(); however, this member is public for initialization. 57 }
56 * @type {boolean}
57 */
58 this.enabled = true;
59 }; 58 };
60 59
61 60
62 /** 61 /**
62 * Public static flag set to enable or disable earcons. Callers should prefer
63 * toggle(); however, this member is public for initialization.
64 * @type {boolean}
65 */
66 cvox.AbstractEarcons.enabled = true;
67
68
69 /**
63 * Plays the specified earcon sound. 70 * Plays the specified earcon sound.
64 * @param {cvox.Earcon} earcon An earcon identifier. 71 * @param {cvox.Earcon} earcon An earcon identifier.
65 */ 72 */
66 cvox.AbstractEarcons.prototype.playEarcon = function(earcon) { 73 cvox.AbstractEarcons.prototype.playEarcon = function(earcon) {
67 }; 74 };
68 75
69 76
70 /** 77 /**
71 * Whether or not earcons are available. 78 * Whether or not earcons are available.
72 * @return {boolean} True if earcons are available. 79 * @return {boolean} True if earcons are available.
73 */ 80 */
74 cvox.AbstractEarcons.prototype.earconsAvailable = function() { 81 cvox.AbstractEarcons.prototype.earconsAvailable = function() {
75 return true; 82 return true;
76 }; 83 };
77 84
78 85
79 /** 86 /**
80 * Toggles earcons on or off. 87 * Toggles earcons on or off.
81 * @return {boolean} True if earcons are now enabled; false otherwise. 88 * @return {boolean} True if earcons are now enabled; false otherwise.
82 */ 89 */
83 cvox.AbstractEarcons.prototype.toggle = function() { 90 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
84 this.enabled = !this.enabled; 91 cvox.AbstractEarcons.enabled = !cvox.AbstractEarcons.enabled;
85 return this.enabled; 92 return cvox.AbstractEarcons.enabled;
86 }; 93 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698