| 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 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 } | 651 } |
| 652 }); | 652 }); |
| 653 if (!actionNodeSpan) | 653 if (!actionNodeSpan) |
| 654 return; | 654 return; |
| 655 var actionNode = actionNodeSpan.node; | 655 var actionNode = actionNodeSpan.node; |
| 656 if (actionNode.role === RoleType.inlineTextBox) | 656 if (actionNode.role === RoleType.inlineTextBox) |
| 657 actionNode = actionNode.parent; | 657 actionNode = actionNode.parent; |
| 658 actionNode.doDefault(); | 658 actionNode.doDefault(); |
| 659 if (selectionSpan) { | 659 if (selectionSpan) { |
| 660 var start = text.getSpanStart(selectionSpan); | 660 var start = text.getSpanStart(selectionSpan); |
| 661 var targetPosition = position - start + selectionSpan.offset; | 661 var targetPosition = position - start; |
| 662 actionNode.setSelection(targetPosition, targetPosition); | 662 actionNode.setSelection(targetPosition, targetPosition); |
| 663 } | 663 } |
| 664 }, | 664 }, |
| 665 | 665 |
| 666 /** | 666 /** |
| 667 * @param {Object} msg A message sent from a content script. | 667 * @param {Object} msg A message sent from a content script. |
| 668 * @param {Port} port | 668 * @param {Port} port |
| 669 * @private | 669 * @private |
| 670 */ | 670 */ |
| 671 onMessage_: function(msg, port) { | 671 onMessage_: function(msg, port) { |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 return new RegExp('^(' + globs.map(function(glob) { | 825 return new RegExp('^(' + globs.map(function(glob) { |
| 826 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') | 826 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') |
| 827 .replace(/\*/g, '.*') | 827 .replace(/\*/g, '.*') |
| 828 .replace(/\?/g, '.'); | 828 .replace(/\?/g, '.'); |
| 829 }).join('|') + ')$'); | 829 }).join('|') + ')$'); |
| 830 }; | 830 }; |
| 831 | 831 |
| 832 new Background(); | 832 new Background(); |
| 833 | 833 |
| 834 }); // goog.scope | 834 }); // goog.scope |
| OLD | NEW |