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

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

Issue 2481013011: Add a page to explain earcons in the tutorial (Closed)
Patch Set: Yay; tests caught regression! 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
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/tutorial.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 if (prevRange && prevRange.start.node) { 779 if (prevRange && prevRange.start.node) {
780 var entered = AutomationUtil.getUniqueAncestors( 780 var entered = AutomationUtil.getUniqueAncestors(
781 prevRange.start.node, start); 781 prevRange.start.node, start);
782 var embeddedObject = entered.find(function(f) { 782 var embeddedObject = entered.find(function(f) {
783 return f.role == RoleType.embeddedObject; }); 783 return f.role == RoleType.embeddedObject; });
784 if (embeddedObject) 784 if (embeddedObject)
785 embeddedObject.focus(); 785 embeddedObject.focus();
786 } 786 }
787 787
788 // Next, try to focus the start or end node. 788 // Next, try to focus the start or end node.
789 if (isFocusableLinkOrControl(start)) { 789 if (!AutomationPredicate.structuralContainer(start) &&
790 start.state.focusable) {
790 if (!start.state.focused) 791 if (!start.state.focused)
791 start.focus(); 792 start.focus();
792 return; 793 return;
793 } else if (isFocusableLinkOrControl(end)) { 794 } else if (!AutomationPredicate.structuralContainer(end) &&
795 end.state.focusable) {
794 if (!end.state.focused) 796 if (!end.state.focused)
795 end.focus(); 797 end.focus();
796 return; 798 return;
797 } 799 }
798 800
799 // If a common ancestor of |start| and |end| is a link, focus that. 801 // If a common ancestor of |start| and |end| is a link, focus that.
800 var ancestor = AutomationUtil.getLeastCommonAncestor(start, end); 802 var ancestor = AutomationUtil.getLeastCommonAncestor(start, end);
801 while (ancestor && ancestor.root == start.root) { 803 while (ancestor && ancestor.root == start.root) {
802 if (isFocusableLinkOrControl(ancestor)) { 804 if (isFocusableLinkOrControl(ancestor)) {
803 if (!ancestor.state.focused) 805 if (!ancestor.state.focused)
(...skipping 21 matching lines...) Expand all
825 return new RegExp('^(' + globs.map(function(glob) { 827 return new RegExp('^(' + globs.map(function(glob) {
826 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&') 828 return glob.replace(/[.+^$(){}|[\]\\]/g, '\\$&')
827 .replace(/\*/g, '.*') 829 .replace(/\*/g, '.*')
828 .replace(/\?/g, '.'); 830 .replace(/\?/g, '.');
829 }).join('|') + ')$'); 831 }).join('|') + ')$');
830 }; 832 };
831 833
832 new Background(); 834 new Background();
833 835
834 }); // goog.scope 836 }); // goog.scope
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/tutorial.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698