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

Unified Diff: chrome/browser/resources/chromeos/chromevox/host/chrome/braille_table.js

Issue 589133002: Make undefined Unicode characters show up in a nicer way in braille. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@moretables
Patch Set: Fix typo. Created 6 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/host/chrome/braille_table.js
diff --git a/chrome/browser/resources/chromeos/chromevox/host/chrome/braille_table.js b/chrome/browser/resources/chromeos/chromevox/host/chrome/braille_table.js
index e3689000ce96a61150003362d43ffa1f42bb2daa..a03e136834934828636d42171066954c16d9bd88 100644
--- a/chrome/browser/resources/chromeos/chromevox/host/chrome/braille_table.js
+++ b/chrome/browser/resources/chromeos/chromevox/host/chrome/braille_table.js
@@ -16,7 +16,7 @@ goog.provide('cvox.BrailleTable');
* id:string,
* grade:(string|undefined),
* variant:(string|undefined),
- * fileName:string
+ * fileNames:string
* }}
*/
cvox.BrailleTable.Table;
@@ -29,10 +29,24 @@ cvox.BrailleTable.TABLE_PATH = 'chromevox/background/braille/tables.json';
/**
+ * @const {string}
+ * @private
+ */
+cvox.BrailleTable.COMMON_DEFS_FILENAME_ = 'cvox-common.cti';
+
+
+/**
* Retrieves a list of all available braille tables.
* @param {function(!Array.<cvox.BrailleTable.Table>)} callback
*/
cvox.BrailleTable.getAll = function(callback) {
+ function appendCommonFilename(tables) {
+ // Append the common definitions to all table filenames.
+ tables.forEach(function(table) {
+ table.fileNames += (',' + cvox.BrailleTable.COMMON_DEFS_FILENAME_);
+ });
+ return tables;
+ }
var url = chrome.extension.getURL(cvox.BrailleTable.TABLE_PATH);
if (!url) {
throw 'Invalid path: ' + cvox.BrailleTable.TABLE_PATH;
@@ -43,8 +57,10 @@ cvox.BrailleTable.getAll = function(callback) {
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
- callback(/** @type {!Array.<cvox.BrailleTable.Table>} */ (
- JSON.parse(xhr.responseText)));
+ callback(
+ appendCommonFilename(
+ /** @type {!Array.<cvox.BrailleTable.Table>} */ (
+ JSON.parse(xhr.responseText))));
}
}
};

Powered by Google App Engine
This is Rietveld 408576698