| 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 The entry point for all ChromeVox2 related code for the | 6 * @fileoverview The entry point for all ChromeVox2 related code for the |
| 7 * background page. | 7 * background page. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 goog.provide('Background'); | 10 goog.provide('Background'); |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 break; | 178 break; |
| 179 case 'continuousRead': | 179 case 'continuousRead': |
| 180 global.isReadingContinuously = true; | 180 global.isReadingContinuously = true; |
| 181 var continueReading = function(prevRange) { | 181 var continueReading = function(prevRange) { |
| 182 if (!global.isReadingContinuously) | 182 if (!global.isReadingContinuously) |
| 183 return; | 183 return; |
| 184 | 184 |
| 185 new Output().withSpeechAndBraille( | 185 new Output().withSpeechAndBraille( |
| 186 this.currentRange_, prevRange, Output.EventType.NAVIGATE) | 186 this.currentRange_, prevRange, Output.EventType.NAVIGATE) |
| 187 .onSpeechEnd(function() { continueReading(prevRange); }) | 187 .onSpeechEnd(function() { continueReading(prevRange); }) |
| 188 .onSpeechInterrupted( | |
| 189 function() { global.isReadingContinuously = false; }) | |
| 190 .go(); | 188 .go(); |
| 191 prevRange = this.currentRange_; | 189 prevRange = this.currentRange_; |
| 192 this.currentRange_ = | 190 this.currentRange_ = |
| 193 this.currentRange_.move(cursors.Unit.NODE, Dir.FORWARD); | 191 this.currentRange_.move(cursors.Unit.NODE, Dir.FORWARD); |
| 194 | 192 |
| 195 if (this.currentRange_.equals(prevRange)) | 193 if (this.currentRange_.equals(prevRange)) |
| 196 global.isReadingContinuously = false; | 194 global.isReadingContinuously = false; |
| 197 }.bind(this); | 195 }.bind(this); |
| 198 | 196 |
| 199 continueReading(null); | 197 continueReading(null); |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 }.bind(this)); | 371 }.bind(this)); |
| 374 } | 372 } |
| 375 }.bind(this)); | 373 }.bind(this)); |
| 376 } | 374 } |
| 377 }; | 375 }; |
| 378 | 376 |
| 379 /** @type {Background} */ | 377 /** @type {Background} */ |
| 380 global.backgroundObj = new Background(); | 378 global.backgroundObj = new Background(); |
| 381 | 379 |
| 382 }); // goog.scope | 380 }); // goog.scope |
| OLD | NEW |