Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js

Issue 2487043002: Refine braille output (Closed)
Patch Set: Refine braille output Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698