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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 */ | 69 */ |
70 this.displayState_ = {available: false, textCellCount: undefined}; | 70 this.displayState_ = {available: false, textCellCount: undefined}; |
71 /** | 71 /** |
72 * State reported from the chrome api, reflecting a real hardware | 72 * State reported from the chrome api, reflecting a real hardware |
73 * display. | 73 * display. |
74 * @type {!cvox.BrailleDisplayState} | 74 * @type {!cvox.BrailleDisplayState} |
75 * @private | 75 * @private |
76 */ | 76 */ |
77 this.realDisplayState_ = this.displayState_; | 77 this.realDisplayState_ = this.displayState_; |
78 /** | 78 /** |
79 * @type {!Array.<number>} | 79 * @type {!Array<number>} |
80 * @private | 80 * @private |
81 */ | 81 */ |
82 this.textToBraille_ = []; | 82 this.textToBraille_ = []; |
83 /** | 83 /** |
84 * @type {!Array.<number>} | 84 * @type {!Array<number>} |
85 * @private | 85 * @private |
86 */ | 86 */ |
87 this.brailleToText_ = []; | 87 this.brailleToText_ = []; |
88 | 88 |
89 translatorManager.addChangeListener(function() { | 89 translatorManager.addChangeListener(function() { |
90 this.translateContent_(this.content_, this.expansionType_); | 90 this.translateContent_(this.content_, this.expansionType_); |
91 }.bind(this)); | 91 }.bind(this)); |
92 | 92 |
93 chrome.storage.onChanged.addListener(function(changes, area) { | 93 chrome.storage.onChanged.addListener(function(changes, area) { |
94 if (area == 'local' && 'brailleWordWrap' in changes) { | 94 if (area == 'local' && 'brailleWordWrap' in changes) { |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 */ | 386 */ |
387 cvox.BrailleDisplayManager.prototype.updatePanStrategy_ = function(wordWrap) { | 387 cvox.BrailleDisplayManager.prototype.updatePanStrategy_ = function(wordWrap) { |
388 var newStrategy = wordWrap ? new cvox.WrappingPanStrategy() : | 388 var newStrategy = wordWrap ? new cvox.WrappingPanStrategy() : |
389 new cvox.FixedPanStrategy(); | 389 new cvox.FixedPanStrategy(); |
390 newStrategy.setDisplaySize(this.displayState_.textCellCount || 0); | 390 newStrategy.setDisplaySize(this.displayState_.textCellCount || 0); |
391 newStrategy.setContent(this.translatedContent_, | 391 newStrategy.setContent(this.translatedContent_, |
392 this.panStrategy_.viewPort.start); | 392 this.panStrategy_.viewPort.start); |
393 this.panStrategy_ = newStrategy; | 393 this.panStrategy_ = newStrategy; |
394 this.refresh_(); | 394 this.refresh_(); |
395 }; | 395 }; |
OLD | NEW |