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 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 // When in compat mode, if the focus is within the desktop tree proper, | 620 // When in compat mode, if the focus is within the desktop tree proper, |
621 // then do not disable content scripts. | 621 // then do not disable content scripts. |
622 if (this.currentRange_ && | 622 if (this.currentRange_ && |
623 this.currentRange_.start.node.root.role == RoleType.desktop) | 623 this.currentRange_.start.node.root.role == RoleType.desktop) |
624 return; | 624 return; |
625 | 625 |
626 this.disableClassicChromeVox_(); | 626 this.disableClassicChromeVox_(); |
627 } | 627 } |
628 }.bind(this)); | 628 }.bind(this)); |
629 | 629 |
| 630 // If switching out of a ChromeVox Next mode, make sure we cancel |
| 631 // the progress loading sound just in case. |
| 632 if ((this.mode_ === ChromeVoxMode.NEXT || |
| 633 this.mode_ === ChromeVoxMode.FORCE_NEXT) && |
| 634 this.mode_ != mode) { |
| 635 cvox.ChromeVox.earcons.cancelEarcon(cvox.Earcon.PAGE_START_LOADING); |
| 636 } |
| 637 |
630 this.mode_ = mode; | 638 this.mode_ = mode; |
631 }, | 639 }, |
632 | 640 |
633 /** | 641 /** |
634 * @param {!Spannable} text | 642 * @param {!Spannable} text |
635 * @param {number} position | 643 * @param {number} position |
636 * @private | 644 * @private |
637 */ | 645 */ |
638 brailleRoutingCommand_: function(text, position) { | 646 brailleRoutingCommand_: function(text, position) { |
639 var actionNodeSpan = null; | 647 var actionNodeSpan = null; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') | 704 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') |
697 .replace(/\*/g, '.*') | 705 .replace(/\*/g, '.*') |
698 .replace(/\?/g, '.'); | 706 .replace(/\?/g, '.'); |
699 }).join('|') + ')$'); | 707 }).join('|') + ')$'); |
700 }; | 708 }; |
701 | 709 |
702 /** @type {Background} */ | 710 /** @type {Background} */ |
703 global.backgroundObj = new Background(); | 711 global.backgroundObj = new Background(); |
704 | 712 |
705 }); // goog.scope | 713 }); // goog.scope |
OLD | NEW |