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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 var continueReading = function(prevRange) { | 405 var continueReading = function(prevRange) { |
406 if (!global.isReadingContinuously || !this.currentRange_) | 406 if (!global.isReadingContinuously || !this.currentRange_) |
407 return; | 407 return; |
408 | 408 |
409 new Output().withSpeechAndBraille( | 409 new Output().withSpeechAndBraille( |
410 this.currentRange_, prevRange, Output.EventType.NAVIGATE) | 410 this.currentRange_, prevRange, Output.EventType.NAVIGATE) |
411 .onSpeechEnd(function() { continueReading(prevRange); }) | 411 .onSpeechEnd(function() { continueReading(prevRange); }) |
412 .go(); | 412 .go(); |
413 prevRange = this.currentRange_; | 413 prevRange = this.currentRange_; |
414 this.setCurrentRange( | 414 this.setCurrentRange( |
415 this.currentRange_.move(cursors.Unit.NODE, Dir.FORWARD)); | 415 this.currentRange_.move(cursors.Unit.DOM_NODE, Dir.FORWARD)); |
416 | 416 |
417 if (!this.currentRange_ || this.currentRange_.equals(prevRange)) | 417 if (!this.currentRange_ || this.currentRange_.equals(prevRange)) |
418 global.isReadingContinuously = false; | 418 global.isReadingContinuously = false; |
419 }.bind(this); | 419 }.bind(this); |
420 | 420 |
421 continueReading(null); | 421 continueReading(null); |
422 return false; | 422 return false; |
423 case 'showContextMenu': | 423 case 'showContextMenu': |
424 if (this.currentRange_) { | 424 if (this.currentRange_) { |
425 var actionNode = this.currentRange_.start.node; | 425 var actionNode = this.currentRange_.start.node; |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') | 675 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') |
676 .replace(/\*/g, '.*') | 676 .replace(/\*/g, '.*') |
677 .replace(/\?/g, '.'); | 677 .replace(/\?/g, '.'); |
678 }).join('|') + ')$'); | 678 }).join('|') + ')$'); |
679 }; | 679 }; |
680 | 680 |
681 /** @type {Background} */ | 681 /** @type {Background} */ |
682 global.backgroundObj = new Background(); | 682 global.backgroundObj = new Background(); |
683 | 683 |
684 }); // goog.scope | 684 }); // goog.scope |
OLD | NEW |