OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 /** |
| 6 * @fileoverview Bridge that sends earcon messages from content scripts or |
| 7 * other pages to the main background page. |
| 8 */ |
| 9 |
| 10 goog.provide('cvox.RemoteEarconsManager'); |
| 11 |
| 12 goog.require('cvox.AbstractEarconsManager'); |
| 13 goog.require('cvox.ExtensionBridge'); |
| 14 |
| 15 if (BUILD_TYPE == BUILD_TYPE_CHROME) { |
| 16 /** |
| 17 * @constructor |
| 18 * @extends {cvox.AbstractEarconsManager} |
| 19 */ |
| 20 cvox.RemoteEarconsManager = function() { |
| 21 cvox.AbstractEarconsManager.call(this); |
| 22 }; |
| 23 goog.inherits(cvox.RemoteEarconsManager, cvox.AbstractEarconsManager); |
| 24 |
| 25 /** |
| 26 * @return {string} The human-readable name of this instance. |
| 27 */ |
| 28 cvox.RemoteEarconsManager.prototype.getName = function() { |
| 29 return 'RemoteEarconsManager'; |
| 30 }; |
| 31 |
| 32 /** |
| 33 * Plays the specified earcon. |
| 34 * @param {number} earcon The earcon to be played. |
| 35 */ |
| 36 cvox.RemoteEarconsManager.prototype.playEarcon = function(earcon) { |
| 37 cvox.RemoteEarconsManager.superClass_.playEarcon.call(this, earcon); |
| 38 cvox.ExtensionBridge.send({ |
| 39 'target': 'EARCON', |
| 40 'action': 'play', |
| 41 'earcon': earcon}); |
| 42 }; |
| 43 |
| 44 /** |
| 45 * Switch to the next earcon set and optionally announce its name. |
| 46 * If no earcon sets have been specified this function is a NOOP. |
| 47 * @param {boolean} announce If true, will announce the name of the |
| 48 * new earcon set. |
| 49 */ |
| 50 cvox.RemoteEarconsManager.prototype.nextEarcons = function(announce) { |
| 51 cvox.RemoteEarconsManager.superClass_.nextEarcons.call(this, announce); |
| 52 cvox.ExtensionBridge.send({ |
| 53 'target': 'EARCON', |
| 54 'action': 'nextEarcons'}); |
| 55 }; |
| 56 |
| 57 } else { |
| 58 cvox.RemoteEarconsManager = function() {}; |
| 59 } |
OLD | NEW |