Chromium Code Reviews| 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 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |