Chromium Code Reviews| 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 08b3cf6c5489fd265c7c93feda1ec899b9119ae4..3ac9e4307f35c818230aac01870f9c916549b708 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,41 @@ 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 = [['Unused', brailleChars]]; |
|
dmazzoni
2016/12/05 17:29:41
Maybe it should say "Image"
ultimatedbz
2016/12/05 19:32:01
Done.
|
| + if (cvox.ChromeVox.isChromeOS) { |
|
dmazzoni
2016/12/05 17:29:40
You don't need to worry about this being false,
th
ultimatedbz
2016/12/05 19:32:01
Is chromeVox supported on other OS's besides Chrom
|
| + var data = {groups: groups, rows: rows, cols: columns}; |
| + (new PanelCommand(PanelCommandType.UPDATE_BRAILLE, data)).send(); |
| + } else { |
| + /* |
| + cvox.ExtensionBridge.send({ |
| + message: 'BRAILLE_CAPTION', |
| + text: text, |
| + brailleChars: brailleChars |
| + }); |
| + */ |
| + } |
| +}; |
| + |
| + |
| + |
| + |
| +/** |
| * @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 |