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

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

Issue 637223006: Initial support for Ranges over automation nodes (used to track ChromeVox focus). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add tests for range. Created 6 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 ChromeVox utilities for the automation extension API. 6 * @fileoverview ChromeVox utilities for the automation extension API.
7 */ 7 */
8 8
9 goog.provide('AutomationUtil'); 9 goog.provide('AutomationUtil');
10 goog.provide('AutomationUtil.Dir'); 10 goog.provide('AutomationUtil.Dir');
(...skipping 12 matching lines...) Expand all
23 AutomationUtil.Dir = { 23 AutomationUtil.Dir = {
24 // Search from left to right. 24 // Search from left to right.
25 FORWARD: 'forward', 25 FORWARD: 'forward',
26 26
27 // Search from right to left. 27 // Search from right to left.
28 BACKWARD: 'backward' 28 BACKWARD: 'backward'
29 }; 29 };
30 30
31 31
32 goog.scope(function() { 32 goog.scope(function() {
33 var AutomationNode = chrome.automation.AutomationNode;
dmazzoni 2014/10/24 16:13:29 Replace chrome.automation.AutomationNode with Auto
33 var Dir = AutomationUtil.Dir; 34 var Dir = AutomationUtil.Dir;
34 35
35 /** 36 /**
36 * Find a node in subtree of |cur| satisfying |pred| using pre-order traversal. 37 * Find a node in subtree of |cur| satisfying |pred| using pre-order traversal.
37 * @param {chrome.automation.AutomationNode} cur Node to begin the search from. 38 * @param {chrome.automation.AutomationNode} cur Node to begin the search from.
38 * @param {Dir} dir 39 * @param {Dir} dir
39 * @param {AutomationPredicate.Unary} pred A predicate to apply 40 * @param {AutomationPredicate.Unary} pred A predicate to apply
40 * to a candidate node. 41 * to a candidate node.
41 * @return {chrome.automation.AutomationNode} 42 * @return {chrome.automation.AutomationNode}
42 */ 43 */
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 if (!satisfied) 149 if (!satisfied)
149 before = candidate; 150 before = candidate;
150 else 151 else
151 after = candidate; 152 after = candidate;
152 return satisfied; 153 return satisfied;
153 }); 154 });
154 return opt_options.before ? before : after; 155 return opt_options.before ? before : after;
155 }; 156 };
156 157
157 }); // goog.scope 158 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698