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

Unified Diff: chrome/browser/resources/chromeos/chromevox/braille/liblouis.js

Issue 2954413003: Support rich line output in both speech and braille (Closed)
Patch Set: Fix browser test Created 3 years, 6 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/braille/liblouis.js
diff --git a/chrome/browser/resources/chromeos/chromevox/braille/liblouis.js b/chrome/browser/resources/chromeos/chromevox/braille/liblouis.js
index ddd3b8bcb7daca98140161105591301f0e9ffc83..a0c02f2f40a04840e7a16691ebecaaa7946d40d2 100644
--- a/chrome/browser/resources/chromeos/chromevox/braille/liblouis.js
+++ b/chrome/browser/resources/chromeos/chromevox/braille/liblouis.js
@@ -7,7 +7,7 @@
*/
goog.provide('cvox.LibLouis');
-
+goog.provide('cvox.LibLouis.FormType');
/**
* Encapsulates a liblouis Native Client instance in the page.
@@ -49,6 +49,20 @@ cvox.LibLouis = function(nmfPath, opt_tablesDir) {
};
+/**
+ * Constants taken from liblouis.h.
+ * Controls braille indicator insertion during translation.
+ * @enum {number}
+ */
+cvox.LibLouis.FormType = {
+ PLAIN_TEXT: 0,
+ ITALIC: 1,
+ UNDERLINE: 2,
+ BOLD: 4,
+ COMPUTER_BRAILLE: 8
+};
+
+
/**
* Set to {@code true} to enable debug logging of RPC messages.
* @type {boolean}
@@ -239,12 +253,17 @@ cvox.LibLouis.Translator = function(instance, tableNames) {
* text positions. If translation fails for any reason, all parameters are
* {@code null}.
*/
-cvox.LibLouis.Translator.prototype.translate = function(text, callback) {
+cvox.LibLouis.Translator.prototype.translate = function(
+ text, formTypeMap, callback) {
if (!this.instance_.isAttached()) {
callback(null /*cells*/, null /*textToBraille*/, null /*brailleToText*/);
return;
}
- var message = {'table_names': this.tableNames_, 'text': text};
+ var message = {
+ 'table_names': this.tableNames_,
+ 'text': text,
+ form_type_map: formTypeMap
+ };
this.instance_.rpc_('Translate', message, function(reply) {
var cells = null;
var textToBraille = null;

Powered by Google App Engine
This is Rietveld 408576698