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 goog.provide('cvox.BrailleTextHandler'); | 5 goog.provide('cvox.BrailleTextHandler'); |
6 | 6 |
7 goog.require('cvox.BrailleInterface'); | 7 goog.require('cvox.BrailleInterface'); |
8 goog.require('cvox.BrailleUtil'); | 8 goog.require('cvox.BrailleUtil'); |
9 goog.require('cvox.ChromeVox'); | 9 goog.require('cvox.ChromeVox'); |
10 goog.require('cvox.NavBraille'); | 10 goog.require('cvox.NavBraille'); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 * fields). | 42 * fields). |
43 */ | 43 */ |
44 cvox.BrailleTextHandler.prototype.changed = function( | 44 cvox.BrailleTextHandler.prototype.changed = function( |
45 line, start, end, multiline, element, lineStart) { | 45 line, start, end, multiline, element, lineStart) { |
46 var content; | 46 var content; |
47 if (multiline) { | 47 if (multiline) { |
48 var spannable = cvox.BrailleUtil.createValue(line, start, end, lineStart); | 48 var spannable = cvox.BrailleUtil.createValue(line, start, end, lineStart); |
49 if (element) { | 49 if (element) { |
50 spannable.setSpan(element, 0, line.length); | 50 spannable.setSpan(element, 0, line.length); |
51 } | 51 } |
52 content = new cvox.NavBraille({text: spannable, | 52 content = new cvox.NavBraille( |
53 startIndex: start, | 53 {text: spannable, startIndex: start, endIndex: end}); |
54 endIndex: end}); | |
55 } else { | 54 } else { |
56 if (cvox.ChromeVox.navigationManager) { | 55 if (cvox.ChromeVox.navigationManager) { |
57 content = cvox.ChromeVox.navigationManager.getBraille(); | 56 content = cvox.ChromeVox.navigationManager.getBraille(); |
58 } | 57 } |
59 } | 58 } |
60 if (content) { | 59 if (content) { |
61 this.braille_.write(content); | 60 this.braille_.write(content); |
62 } | 61 } |
63 }; | 62 }; |
OLD | NEW |