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 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 | 93 |
| 94 /** @type {AutomationPredicate.Unary} */ | 94 /** @type {AutomationPredicate.Unary} */ |
| 95 AutomationPredicate.formField = AutomationPredicate.match({ | 95 AutomationPredicate.formField = AutomationPredicate.match({ |
| 96 anyPredicate: [ | 96 anyPredicate: [ |
| 97 AutomationPredicate.button, | 97 AutomationPredicate.button, |
| 98 AutomationPredicate.comboBox, | 98 AutomationPredicate.comboBox, |
| 99 AutomationPredicate.editText | 99 AutomationPredicate.editText |
| 100 ], | 100 ], |
| 101 anyRole: [ | 101 anyRole: [ |
| 102 Role.checkBox, | 102 Role.checkBox, |
| 103 Role.colorWell, | |
|
David Tseng
2016/10/27 22:42:38
Looks like this is just input type color. Needs an
| |
| 103 Role.listBox, | 104 Role.listBox, |
| 104 Role.slider, | 105 Role.slider, |
| 105 Role.tab, | 106 Role.switch, |
|
David Tseng
2016/10/27 22:42:38
Didn't know about this role...
this one needs an o
dmazzoni
2016/10/27 22:56:02
What would you think if automation exposed a much
| |
| 106 Role.tree | 107 Role.tree |
| 107 ] | 108 ] |
| 108 }); | 109 }); |
| 109 | 110 |
| 110 /** @type {AutomationPredicate.Unary} */ | 111 /** @type {AutomationPredicate.Unary} */ |
| 112 AutomationPredicate.control = AutomationPredicate.match({ | |
| 113 anyPredicate: [ | |
| 114 AutomationPredicate.formField, | |
| 115 ], | |
| 116 anyRole: [ | |
| 117 Role.disclosureTriangle, | |
| 118 Role.menuItem, | |
| 119 Role.menuItemCheckBox, | |
| 120 Role.menuItemRadio, | |
| 121 Role.menuListOption, | |
| 122 Role.scrollBar, | |
| 123 Role.tab | |
| 124 ] | |
| 125 }); | |
| 126 | |
| 127 /** @type {AutomationPredicate.Unary} */ | |
| 128 AutomationPredicate.linkOrControl = AutomationPredicate.match({ | |
| 129 anyPredicate: [ | |
| 130 AutomationPredicate.control | |
| 131 ], | |
| 132 anyRole: [ | |
| 133 Role.link | |
| 134 ] | |
| 135 }); | |
| 136 | |
| 137 /** @type {AutomationPredicate.Unary} */ | |
| 111 AutomationPredicate.landmark = AutomationPredicate.roles([ | 138 AutomationPredicate.landmark = AutomationPredicate.roles([ |
| 112 Role.application, | 139 Role.application, |
| 113 Role.banner, | 140 Role.banner, |
| 114 Role.complementary, | 141 Role.complementary, |
| 115 Role.contentInfo, | 142 Role.contentInfo, |
| 116 Role.form, | 143 Role.form, |
| 117 Role.main, | 144 Role.main, |
| 118 Role.navigation, | 145 Role.navigation, |
| 119 Role.region, | 146 Role.region, |
| 120 Role.search]); | 147 Role.search]); |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 425 * @param {number} level 1-6 | 452 * @param {number} level 1-6 |
| 426 * @return {AutomationPredicate.Unary} | 453 * @return {AutomationPredicate.Unary} |
| 427 */ | 454 */ |
| 428 AutomationPredicate.makeHeadingPredicate = function(level) { | 455 AutomationPredicate.makeHeadingPredicate = function(level) { |
| 429 return function(node) { | 456 return function(node) { |
| 430 return node.role == Role.heading && node.hierarchicalLevel == level; | 457 return node.role == Role.heading && node.hierarchicalLevel == level; |
| 431 }; | 458 }; |
| 432 }; | 459 }; |
| 433 | 460 |
| 434 }); // goog.scope | 461 }); // goog.scope |
| OLD | NEW |