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

Unified Diff: chrome/browser/resources/chromeos/chromevox/chromevox/background/braille_captions_background.js

Issue 2703663002: Display images in multiline Braille (Closed)
Patch Set: Final feedback Created 3 years, 10 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/chromevox/background/braille_captions_background.js
diff --git a/chrome/browser/resources/chromeos/chromevox/chromevox/background/braille_captions_background.js b/chrome/browser/resources/chromeos/chromevox/chromevox/background/braille_captions_background.js
index caad6340e061f3959306e19d150fcf145d9124c5..796122d8bca90049bae1e3adb3e926f014647043 100644
--- a/chrome/browser/resources/chromeos/chromevox/chromevox/background/braille_captions_background.js
+++ b/chrome/browser/resources/chromeos/chromevox/chromevox/background/braille_captions_background.js
@@ -90,6 +90,28 @@ cvox.BrailleCaptionsBackground.setContent = function(text, cells,
};
/**
+ * @param {ArrayBuffer} cells Braille cells shown on the display.
+ * @param {number} rows Number of rows to display.
+ * @param {number} columns Number of columns to display.
+ */
+cvox.BrailleCaptionsBackground.setImageContent = function(cells, rows,
+ columns) {
+ var self = cvox.BrailleCaptionsBackground;
+ // Convert the cells to Unicode braille pattern characters.
+ var byteBuf = new Uint8Array(cells);
+ var brailleChars = '';
+
+ for (var i = 0; i < byteBuf.length; ++i) {
+ brailleChars += String.fromCharCode(
+ self.BRAILLE_UNICODE_BLOCK_START | byteBuf[i]);
+ }
+
+ var groups = [['Image', brailleChars]];
+ var data = {groups: groups, rows: rows, cols: columns};
+ (new PanelCommand(PanelCommandType.UPDATE_BRAILLE, data)).send();
+};
+
+/**
* @param {string} brailleChars Braille characters shown on the display.
* @param {string} text Text of the shown braille.
* @param {Array<number>} brailleToText Map of Braille cells to the first
@@ -167,6 +189,6 @@ cvox.BrailleCaptionsBackground.getVirtualDisplayState = function(callback) {
});
});
} else {
- callback({available: false});
+ callback({available: false, textRowCount: 0, textColumnCount: 0});
}
};

Powered by Google App Engine
This is Rietveld 408576698