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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 var continueReading = function(prevRange) { | 411 var continueReading = function(prevRange) { |
412 if (!global.isReadingContinuously || !this.currentRange_) | 412 if (!global.isReadingContinuously || !this.currentRange_) |
413 return; | 413 return; |
414 | 414 |
415 new Output().withSpeechAndBraille( | 415 new Output().withSpeechAndBraille( |
416 this.currentRange_, prevRange, Output.EventType.NAVIGATE) | 416 this.currentRange_, prevRange, Output.EventType.NAVIGATE) |
417 .onSpeechEnd(function() { continueReading(prevRange); }) | 417 .onSpeechEnd(function() { continueReading(prevRange); }) |
418 .go(); | 418 .go(); |
419 prevRange = this.currentRange_; | 419 prevRange = this.currentRange_; |
420 this.setCurrentRange( | 420 this.setCurrentRange( |
421 this.currentRange_.move(cursors.Unit.NODE, Dir.FORWARD)); | 421 this.currentRange_.move(cursors.Unit.DOM_NODE, Dir.FORWARD)); |
422 | 422 |
423 if (!this.currentRange_ || this.currentRange_.equals(prevRange)) | 423 if (!this.currentRange_ || this.currentRange_.equals(prevRange)) |
424 global.isReadingContinuously = false; | 424 global.isReadingContinuously = false; |
425 }.bind(this); | 425 }.bind(this); |
426 | 426 |
427 continueReading(null); | 427 continueReading(null); |
428 return false; | 428 return false; |
429 case 'showContextMenu': | 429 case 'showContextMenu': |
430 if (this.currentRange_) { | 430 if (this.currentRange_) { |
431 var actionNode = this.currentRange_.start.node; | 431 var actionNode = this.currentRange_.start.node; |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') | 690 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') |
691 .replace(/\*/g, '.*') | 691 .replace(/\*/g, '.*') |
692 .replace(/\?/g, '.'); | 692 .replace(/\?/g, '.'); |
693 }).join('|') + ')$'); | 693 }).join('|') + ')$'); |
694 }; | 694 }; |
695 | 695 |
696 /** @type {Background} */ | 696 /** @type {Background} */ |
697 global.backgroundObj = new Background(); | 697 global.backgroundObj = new Background(); |
698 | 698 |
699 }); // goog.scope | 699 }); // goog.scope |
OLD | NEW |