| OLD | NEW |
| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 page_start_loading: 'page_start_loading_earcon_description', | 67 page_start_loading: 'page_start_loading_earcon_description', |
| 68 pop_up_button: 'pop_up_button_earcon_description', | 68 pop_up_button: 'pop_up_button_earcon_description', |
| 69 slider: 'slider_earcon_description', | 69 slider: 'slider_earcon_description', |
| 70 wrap: 'wrap_earcon_description', | 70 wrap: 'wrap_earcon_description', |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 | 73 |
| 74 /** | 74 /** |
| 75 * @constructor | 75 * @constructor |
| 76 */ | 76 */ |
| 77 cvox.AbstractEarcons = function() { | 77 cvox.AbstractEarcons = function() {}; |
| 78 }; | |
| 79 | 78 |
| 80 | 79 |
| 81 /** | 80 /** |
| 82 * Public static flag set to enable or disable earcons. Callers should prefer | 81 * Public static flag set to enable or disable earcons. Callers should prefer |
| 83 * toggle(); however, this member is public for initialization. | 82 * toggle(); however, this member is public for initialization. |
| 84 * @type {boolean} | 83 * @type {boolean} |
| 85 */ | 84 */ |
| 86 cvox.AbstractEarcons.enabled = true; | 85 cvox.AbstractEarcons.enabled = true; |
| 87 | 86 |
| 88 | 87 |
| 89 /** | 88 /** |
| 90 * Plays the specified earcon sound. | 89 * Plays the specified earcon sound. |
| 91 * @param {cvox.Earcon} earcon An earcon identifier. | 90 * @param {cvox.Earcon} earcon An earcon identifier. |
| 92 * @param {Object=} opt_location A location associated with the earcon such as a | 91 * @param {Object=} opt_location A location associated with the earcon such as a |
| 93 * control's bounding rectangle. | 92 * control's bounding rectangle. |
| 94 */ | 93 */ |
| 95 cvox.AbstractEarcons.prototype.playEarcon = function(earcon, opt_location) { | 94 cvox.AbstractEarcons.prototype.playEarcon = function(earcon, opt_location) {}; |
| 96 }; | |
| 97 | 95 |
| 98 | 96 |
| 99 /** | 97 /** |
| 100 * Cancels the specified earcon sound. | 98 * Cancels the specified earcon sound. |
| 101 * @param {cvox.Earcon} earcon An earcon identifier. | 99 * @param {cvox.Earcon} earcon An earcon identifier. |
| 102 */ | 100 */ |
| 103 cvox.AbstractEarcons.prototype.cancelEarcon = function(earcon) { | 101 cvox.AbstractEarcons.prototype.cancelEarcon = function(earcon) {}; |
| 104 }; | |
| 105 | 102 |
| 106 | 103 |
| 107 /** | 104 /** |
| 108 * Whether or not earcons are available. | 105 * Whether or not earcons are available. |
| 109 * @return {boolean} True if earcons are available. | 106 * @return {boolean} True if earcons are available. |
| 110 */ | 107 */ |
| 111 cvox.AbstractEarcons.prototype.earconsAvailable = function() { | 108 cvox.AbstractEarcons.prototype.earconsAvailable = function() { |
| 112 return true; | 109 return true; |
| 113 }; | 110 }; |
| 114 | 111 |
| 115 | 112 |
| 116 /** | 113 /** |
| 117 * Toggles earcons on or off. | 114 * Toggles earcons on or off. |
| 118 * @return {boolean} True if earcons are now enabled; false otherwise. | 115 * @return {boolean} True if earcons are now enabled; false otherwise. |
| 119 */ | 116 */ |
| 120 cvox.AbstractEarcons.prototype.toggle = function() { | 117 cvox.AbstractEarcons.prototype.toggle = function() { |
| 121 cvox.AbstractEarcons.enabled = !cvox.AbstractEarcons.enabled; | 118 cvox.AbstractEarcons.enabled = !cvox.AbstractEarcons.enabled; |
| 122 return cvox.AbstractEarcons.enabled; | 119 return cvox.AbstractEarcons.enabled; |
| 123 }; | 120 }; |
| OLD | NEW |