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