Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview Puts text on a braille display. | 6 * @fileoverview Puts text on a braille display. |
| 7 * | 7 * |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 goog.provide('cvox.BrailleDisplayManager'); | 10 goog.provide('cvox.BrailleDisplayManager'); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 188 /** @private */ | 188 /** @private */ |
| 189 cvox.BrailleDisplayManager.prototype.refresh_ = function() { | 189 cvox.BrailleDisplayManager.prototype.refresh_ = function() { |
| 190 if (!this.displayState_.available) { | 190 if (!this.displayState_.available) { |
| 191 return; | 191 return; |
| 192 } | 192 } |
| 193 var viewPort = this.panStrategy_.viewPort; | 193 var viewPort = this.panStrategy_.viewPort; |
| 194 var buf = this.displayedContent_.slice(viewPort.start, viewPort.end); | 194 var buf = this.displayedContent_.slice(viewPort.start, viewPort.end); |
| 195 if (this.realDisplayState_.available) { | 195 if (this.realDisplayState_.available) { |
| 196 chrome.brailleDisplayPrivate.writeDots(buf); | 196 chrome.brailleDisplayPrivate.writeDots(buf); |
| 197 } | 197 } |
| 198 | |
| 199 var start = this.brailleToTextPosition_(viewPort.start); | |
| 200 var end = this.brailleToTextPosition_(viewPort.end); | |
| 201 var brailleText = this.content_.text.toString().substring(start, end); | |
| 198 if (cvox.BrailleCaptionsBackground.isEnabled()) { | 202 if (cvox.BrailleCaptionsBackground.isEnabled()) { |
| 199 var start = this.brailleToTextPosition_(viewPort.start); | 203 cvox.BrailleCaptionsBackground.setContent(brailleText, buf); |
|
Peter Lundblad
2015/11/06 15:00:57
What's the point of this change?
dmazzoni
2015/11/06 21:01:00
Oops, I originally tried hooking into this file to
| |
| 200 var end = this.brailleToTextPosition_(viewPort.end); | |
| 201 cvox.BrailleCaptionsBackground.setContent( | |
| 202 this.content_.text.toString().substring(start, end), buf); | |
| 203 } | 204 } |
| 204 }; | 205 }; |
| 205 | 206 |
| 206 | 207 |
| 207 /** | 208 /** |
| 208 * @param {!cvox.NavBraille} newContent New display content. | 209 * @param {!cvox.NavBraille} newContent New display content. |
| 209 * @param {cvox.ExpandingBrailleTranslator.ExpansionType} newExpansionType | 210 * @param {cvox.ExpandingBrailleTranslator.ExpansionType} newExpansionType |
| 210 * How the value part of of the new content should be expanded | 211 * How the value part of of the new content should be expanded |
| 211 * with regards to contractions. | 212 * with regards to contractions. |
| 212 * @private | 213 * @private |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 386 */ | 387 */ |
| 387 cvox.BrailleDisplayManager.prototype.updatePanStrategy_ = function(wordWrap) { | 388 cvox.BrailleDisplayManager.prototype.updatePanStrategy_ = function(wordWrap) { |
| 388 var newStrategy = wordWrap ? new cvox.WrappingPanStrategy() : | 389 var newStrategy = wordWrap ? new cvox.WrappingPanStrategy() : |
| 389 new cvox.FixedPanStrategy(); | 390 new cvox.FixedPanStrategy(); |
| 390 newStrategy.setDisplaySize(this.displayState_.textCellCount || 0); | 391 newStrategy.setDisplaySize(this.displayState_.textCellCount || 0); |
| 391 newStrategy.setContent(this.translatedContent_, | 392 newStrategy.setContent(this.translatedContent_, |
| 392 this.panStrategy_.viewPort.start); | 393 this.panStrategy_.viewPort.start); |
| 393 this.panStrategy_ = newStrategy; | 394 this.panStrategy_ = newStrategy; |
| 394 this.refresh_(); | 395 this.refresh_(); |
| 395 }; | 396 }; |
| OLD | NEW |