| 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 return null; | 328 return null; |
| 329 }, | 329 }, |
| 330 | 330 |
| 331 /** | 331 /** |
| 332 * @override | 332 * @override |
| 333 */ | 333 */ |
| 334 setCurrentRange: function(newRange) { | 334 setCurrentRange: function(newRange) { |
| 335 if (!this.inExcursion_ && newRange) | 335 if (!this.inExcursion_ && newRange) |
| 336 this.savedRange_ = new cursors.Range(newRange.start, newRange.end); | 336 this.savedRange_ = new cursors.Range(newRange.start, newRange.end); |
| 337 | 337 |
| 338 if (newRange && !newRange.isValid()) |
| 339 return; |
| 340 |
| 338 this.currentRange_ = newRange; | 341 this.currentRange_ = newRange; |
| 339 var oldMode = this.mode_; | 342 var oldMode = this.mode_; |
| 340 var newMode = this.getMode(); | 343 var newMode = this.getMode(); |
| 341 if (oldMode != newMode) { | 344 if (oldMode != newMode) { |
| 342 this.onModeChanged_(newMode, oldMode); | 345 this.onModeChanged_(newMode, oldMode); |
| 343 this.mode_ = newMode; | 346 this.mode_ = newMode; |
| 344 } | 347 } |
| 345 | 348 |
| 346 if (this.currentRange_) { | 349 if (this.currentRange_) { |
| 347 var start = this.currentRange_.start.node; | 350 var start = this.currentRange_.start.node; |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 return new RegExp('^(' + globs.map(function(glob) { | 751 return new RegExp('^(' + globs.map(function(glob) { |
| 749 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') | 752 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') |
| 750 .replace(/\*/g, '.*') | 753 .replace(/\*/g, '.*') |
| 751 .replace(/\?/g, '.'); | 754 .replace(/\?/g, '.'); |
| 752 }).join('|') + ')$'); | 755 }).join('|') + ')$'); |
| 753 }; | 756 }; |
| 754 | 757 |
| 755 new Background(); | 758 new Background(); |
| 756 | 759 |
| 757 }); // goog.scope | 760 }); // goog.scope |
| OLD | NEW |