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

Side by Side Diff: ui/accessibility/ax_node_data.cc

Issue 790003003: Exposed the invalid state of form controls to the accessibility APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tried fixing Android unit tests. Created 5 years, 11 months 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 | « ui/accessibility/ax_enums.idl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "ui/accessibility/ax_node_data.h" 5 #include "ui/accessibility/ax_node_data.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 result += " text_direction=rl"; 219 result += " text_direction=rl";
220 break; 220 break;
221 case AX_TEXT_DIRECTION_TB: 221 case AX_TEXT_DIRECTION_TB:
222 result += " text_direction=tb"; 222 result += " text_direction=tb";
223 break; 223 break;
224 case AX_TEXT_DIRECTION_BT: 224 case AX_TEXT_DIRECTION_BT:
225 result += " text_direction=bt"; 225 result += " text_direction=bt";
226 break; 226 break;
227 } 227 }
228 break; 228 break;
229 case AX_ATTR_INVALID_STATE:
230 switch (int_attributes[i].second) {
231 case AX_INVALID_STATE_FALSE:
232 result += " invalid_state=false";
233 break;
234 case AX_INVALID_STATE_TRUE:
235 result += " invalid_state=true";
236 break;
237 case AX_INVALID_STATE_SPELLING:
238 result += " invalid_state=spelling";
239 break;
240 case AX_INVALID_STATE_GRAMMAR:
241 result += " invalid_state=grammar";
242 break;
243 case AX_INVALID_STATE_OTHER:
244 result += " invalid_state=other";
245 break;
246 }
247 break;
229 case AX_INT_ATTRIBUTE_NONE: 248 case AX_INT_ATTRIBUTE_NONE:
230 break; 249 break;
231 } 250 }
232 } 251 }
233 252
234 for (size_t i = 0; i < string_attributes.size(); ++i) { 253 for (size_t i = 0; i < string_attributes.size(); ++i) {
235 std::string value = string_attributes[i].second; 254 std::string value = string_attributes[i].second;
236 switch (string_attributes[i].first) { 255 switch (string_attributes[i].first) {
237 case AX_ATTR_DOC_URL: 256 case AX_ATTR_DOC_URL:
238 result += " doc_url=" + value; 257 result += " doc_url=" + value;
(...skipping 21 matching lines...) Expand all
260 break; 279 break;
261 case AX_ATTR_DISPLAY: 280 case AX_ATTR_DISPLAY:
262 result += " display=" + value; 281 result += " display=" + value;
263 break; 282 break;
264 case AX_ATTR_HELP: 283 case AX_ATTR_HELP:
265 result += " help=" + value; 284 result += " help=" + value;
266 break; 285 break;
267 case AX_ATTR_HTML_TAG: 286 case AX_ATTR_HTML_TAG:
268 result += " html_tag=" + value; 287 result += " html_tag=" + value;
269 break; 288 break;
289 case AX_ATTR_ARIA_INVALID_VALUE:
290 result += " aria_invalid_value=" + value;
291 break;
270 case AX_ATTR_LIVE_RELEVANT: 292 case AX_ATTR_LIVE_RELEVANT:
271 result += " relevant=" + value; 293 result += " relevant=" + value;
272 break; 294 break;
273 case AX_ATTR_LIVE_STATUS: 295 case AX_ATTR_LIVE_STATUS:
274 result += " live=" + value; 296 result += " live=" + value;
275 break; 297 break;
276 case AX_ATTR_CONTAINER_LIVE_RELEVANT: 298 case AX_ATTR_CONTAINER_LIVE_RELEVANT:
277 result += " container_relevant=" + value; 299 result += " container_relevant=" + value;
278 break; 300 break;
279 case AX_ATTR_CONTAINER_LIVE_STATUS: 301 case AX_ATTR_CONTAINER_LIVE_STATUS:
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 } 432 }
411 } 433 }
412 434
413 if (!child_ids.empty()) 435 if (!child_ids.empty())
414 result += " child_ids=" + IntVectorToString(child_ids); 436 result += " child_ids=" + IntVectorToString(child_ids);
415 437
416 return result; 438 return result;
417 } 439 }
418 440
419 } // namespace ui 441 } // namespace ui
OLDNEW
« no previous file with comments | « ui/accessibility/ax_enums.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698