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 predicates for the automation extension API. | 6 * @fileoverview ChromeVox predicates for the automation extension API. |
7 */ | 7 */ |
8 | 8 |
9 goog.provide('AutomationPredicate'); | 9 goog.provide('AutomationPredicate'); |
10 goog.provide('AutomationPredicate.Binary'); | 10 goog.provide('AutomationPredicate.Binary'); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 /** @type {AutomationPredicate.Unary} */ | 64 /** @type {AutomationPredicate.Unary} */ |
65 AutomationPredicate.heading = AutomationPredicate.roles([Role.heading]); | 65 AutomationPredicate.heading = AutomationPredicate.roles([Role.heading]); |
66 /** @type {AutomationPredicate.Unary} */ | 66 /** @type {AutomationPredicate.Unary} */ |
67 AutomationPredicate.inlineTextBox = | 67 AutomationPredicate.inlineTextBox = |
68 AutomationPredicate.roles([Role.inlineTextBox]); | 68 AutomationPredicate.roles([Role.inlineTextBox]); |
69 /** @type {AutomationPredicate.Unary} */ | 69 /** @type {AutomationPredicate.Unary} */ |
70 AutomationPredicate.link = AutomationPredicate.roles([Role.link]); | 70 AutomationPredicate.link = AutomationPredicate.roles([Role.link]); |
71 /** @type {AutomationPredicate.Unary} */ | 71 /** @type {AutomationPredicate.Unary} */ |
72 AutomationPredicate.row = AutomationPredicate.roles([Role.row]); | 72 AutomationPredicate.row = AutomationPredicate.roles([Role.row]); |
73 /** @type {AutomationPredicate.Unary} */ | 73 /** @type {AutomationPredicate.Unary} */ |
| 74 AutomationPredicate.staticText = AutomationPredicate.roles([Role.staticText]); |
| 75 /** @type {AutomationPredicate.Unary} */ |
74 AutomationPredicate.table = AutomationPredicate.roles([Role.grid, Role.table]); | 76 AutomationPredicate.table = AutomationPredicate.roles([Role.grid, Role.table]); |
75 | 77 |
76 /** | 78 /** |
77 * @param {!AutomationNode} node | 79 * @param {!AutomationNode} node |
78 * @return {boolean} | 80 * @return {boolean} |
79 */ | 81 */ |
80 AutomationPredicate.button = function(node) { | 82 AutomationPredicate.button = function(node) { |
81 return /button/i.test(node.role); | 83 return /button/i.test(node.role); |
82 }; | 84 }; |
83 | 85 |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 * @param {number} level 1-6 | 416 * @param {number} level 1-6 |
415 * @return {AutomationPredicate.Unary} | 417 * @return {AutomationPredicate.Unary} |
416 */ | 418 */ |
417 AutomationPredicate.makeHeadingPredicate = function(level) { | 419 AutomationPredicate.makeHeadingPredicate = function(level) { |
418 return function(node) { | 420 return function(node) { |
419 return node.role == Role.heading && node.hierarchicalLevel == level; | 421 return node.role == Role.heading && node.hierarchicalLevel == level; |
420 }; | 422 }; |
421 }; | 423 }; |
422 | 424 |
423 }); // goog.scope | 425 }); // goog.scope |
OLD | NEW |