Chromium Code Reviews| Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js |
| diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js |
| index d2599e1f2934c41044e31ca0d5707ee712a343c2..44318a8f3f9b026d2bd375d0ac78d60d4da404ed 100644 |
| --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js |
| +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js |
| @@ -94,6 +94,12 @@ Output = function() { |
| * @private |
| */ |
| this.outputContextFirst_ = false; |
| + |
| + /** |
| + * @type {string} |
| + * @private |
| + */ |
| + this.imageDataUrl_ = ''; |
| }; |
| /** |
| @@ -941,13 +947,16 @@ Output.prototype = { |
| buff.setSpan(new cvox.ValueSelectionSpan(), startIndex, endIndex); |
| } |
| - var output = new cvox.NavBraille({ |
| - text: buff, |
| - startIndex: startIndex, |
| - endIndex: endIndex |
| - }); |
| - |
| - cvox.ChromeVox.braille.write(output); |
| + if (this.imageDataUrl_) { |
| + cvox.ChromeVox.braille.writeRawImage(this.imageDataUrl_); |
| + } else { |
| + var output = new cvox.NavBraille({ |
| + text: buff, |
| + startIndex: startIndex, |
| + endIndex: endIndex |
| + }); |
| + cvox.ChromeVox.braille.write(output); |
| + } |
| } |
| // Display. |
| @@ -1003,6 +1012,12 @@ Output.prototype = { |
| var tokens = []; |
| var args = null; |
| + if (node != null && |
| + (node.role == RoleType.canvas || node.role == RoleType.image)) { |
| + node.getImageData(0, 0); |
|
dmazzoni
2016/12/06 07:39:06
Oh, I just realized this is going to keep fetching
ultimatedbz
2016/12/07 22:03:48
Done.
|
| + this.imageDataUrl_ = node.imageDataUrl; |
| + } |
| + |
| // Hacky way to support args. |
| if (typeof(format) == 'string') { |
| format = format.replace(/([,:])\W/g, '$1'); |