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 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 description['Reproduction Steps'] = '%0a1.%0a2.%0a3.'; | 743 description['Reproduction Steps'] = '%0a1.%0a2.%0a3.'; |
744 for (var key in description) | 744 for (var key in description) |
745 url += key + ':%20' + description[key] + '%0a'; | 745 url += key + ':%20' + description[key] + '%0a'; |
746 chrome.tabs.create({url: url}); | 746 chrome.tabs.create({url: url}); |
747 return false; | 747 return false; |
748 default: | 748 default: |
749 return true; | 749 return true; |
750 } | 750 } |
751 | 751 |
752 if (pred) { | 752 if (pred) { |
753 var node = AutomationUtil.findNextNode( | 753 var bound = current.getBound(dir).node; |
754 current.getBound(dir).node, dir, pred, {skipInitialAncestry: true}); | 754 if (bound) { |
| 755 var node = AutomationUtil.findNextNode( |
| 756 bound, dir, pred, {skipInitialAncestry: true}); |
| 757 if (node) { |
| 758 node = AutomationUtil.findNodePre( |
| 759 node, dir, AutomationPredicate.element) || node; |
| 760 } |
755 | 761 |
756 if (node) { | 762 if (node) { |
757 node = AutomationUtil.findNodePre( | 763 current = cursors.Range.fromNode(node); |
758 node, dir, AutomationPredicate.element) || node; | 764 } else { |
759 } | 765 if (predErrorMsg) { |
760 | 766 cvox.ChromeVox.tts.speak(Msgs.getMsg(predErrorMsg), |
761 if (node) { | 767 cvox.QueueMode.FLUSH); |
762 current = cursors.Range.fromNode(node); | 768 } |
763 } else { | 769 return false; |
764 if (predErrorMsg) { | |
765 cvox.ChromeVox.tts.speak(Msgs.getMsg(predErrorMsg), | |
766 cvox.QueueMode.FLUSH); | |
767 } | 770 } |
768 return false; | |
769 } | 771 } |
770 } | 772 } |
771 | 773 |
772 if (current) | 774 if (current) |
773 this.navigateToRange_(current); | 775 this.navigateToRange_(current); |
774 | 776 |
775 return false; | 777 return false; |
776 }, | 778 }, |
777 | 779 |
778 /** | 780 /** |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') | 1126 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') |
1125 .replace(/\*/g, '.*') | 1127 .replace(/\*/g, '.*') |
1126 .replace(/\?/g, '.'); | 1128 .replace(/\?/g, '.'); |
1127 }).join('|') + ')$'); | 1129 }).join('|') + ')$'); |
1128 }; | 1130 }; |
1129 | 1131 |
1130 /** @type {Background} */ | 1132 /** @type {Background} */ |
1131 global.backgroundObj = new Background(); | 1133 global.backgroundObj = new Background(); |
1132 | 1134 |
1133 }); // goog.scope | 1135 }); // goog.scope |
OLD | NEW |