OLD | NEW |
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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 break; | 327 break; |
328 case AX_ATTR_SCROLL_Y_MIN: | 328 case AX_ATTR_SCROLL_Y_MIN: |
329 result += " scroll_y_min=" + value; | 329 result += " scroll_y_min=" + value; |
330 break; | 330 break; |
331 case AX_ATTR_SCROLL_Y_MAX: | 331 case AX_ATTR_SCROLL_Y_MAX: |
332 result += " scroll_y_max=" + value; | 332 result += " scroll_y_max=" + value; |
333 break; | 333 break; |
334 case AX_ATTR_HIERARCHICAL_LEVEL: | 334 case AX_ATTR_HIERARCHICAL_LEVEL: |
335 result += " level=" + value; | 335 result += " level=" + value; |
336 break; | 336 break; |
337 case AX_ATTR_ANCHOR_OBJECT_ID: | |
338 result += " anchor_object_id=" + value; | |
339 break; | |
340 case AX_ATTR_ANCHOR_OFFSET: | |
341 result += " anchor_offset=" + value; | |
342 break; | |
343 case AX_ATTR_FOCUS_OBJECT_ID: | |
344 result += " focus_object_id=" + value; | |
345 break; | |
346 case AX_ATTR_FOCUS_OFFSET: | |
347 result += " focus_offset=" + value; | |
348 break; | |
349 case AX_ATTR_TEXT_SEL_START: | 337 case AX_ATTR_TEXT_SEL_START: |
350 result += " sel_start=" + value; | 338 result += " sel_start=" + value; |
351 break; | 339 break; |
352 case AX_ATTR_TEXT_SEL_END: | 340 case AX_ATTR_TEXT_SEL_END: |
353 result += " sel_end=" + value; | 341 result += " sel_end=" + value; |
354 break; | 342 break; |
355 case AX_ATTR_TABLE_ROW_COUNT: | 343 case AX_ATTR_TABLE_ROW_COUNT: |
356 result += " rows=" + value; | 344 result += " rows=" + value; |
357 break; | 345 break; |
358 case AX_ATTR_TABLE_COLUMN_COUNT: | 346 case AX_ATTR_TABLE_COLUMN_COUNT: |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 result += " sort_direction=other"; | 388 result += " sort_direction=other"; |
401 break; | 389 break; |
402 } | 390 } |
403 break; | 391 break; |
404 case AX_ATTR_TITLE_UI_ELEMENT: | 392 case AX_ATTR_TITLE_UI_ELEMENT: |
405 result += " title_elem=" + value; | 393 result += " title_elem=" + value; |
406 break; | 394 break; |
407 case AX_ATTR_ACTIVEDESCENDANT_ID: | 395 case AX_ATTR_ACTIVEDESCENDANT_ID: |
408 result += " activedescendant=" + value; | 396 result += " activedescendant=" + value; |
409 break; | 397 break; |
410 case AX_ATTR_TREE_ID: | |
411 result += " tree_id=" + value; | |
412 break; | |
413 case AX_ATTR_CHILD_TREE_ID: | 398 case AX_ATTR_CHILD_TREE_ID: |
414 result += " child_tree_id=" + value; | 399 result += " child_tree_id=" + value; |
415 break; | 400 break; |
416 case AX_ATTR_PARENT_TREE_ID: | |
417 result += " parent_tree_id=" + value; | |
418 break; | |
419 case AX_ATTR_COLOR_VALUE: | 401 case AX_ATTR_COLOR_VALUE: |
420 result += base::StringPrintf(" color_value=&%X", | 402 result += base::StringPrintf(" color_value=&%X", |
421 int_attributes[i].second); | 403 int_attributes[i].second); |
422 break; | 404 break; |
423 case AX_ATTR_BACKGROUND_COLOR: | 405 case AX_ATTR_BACKGROUND_COLOR: |
424 result += base::StringPrintf(" background_color=&%X", | 406 result += base::StringPrintf(" background_color=&%X", |
425 int_attributes[i].second); | 407 int_attributes[i].second); |
426 break; | 408 break; |
427 case AX_ATTR_COLOR: | 409 case AX_ATTR_COLOR: |
428 result += base::StringPrintf(" color=&%X", int_attributes[i].second); | 410 result += base::StringPrintf(" color=&%X", int_attributes[i].second); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 } | 466 } |
485 break; | 467 break; |
486 case AX_INT_ATTRIBUTE_NONE: | 468 case AX_INT_ATTRIBUTE_NONE: |
487 break; | 469 break; |
488 } | 470 } |
489 } | 471 } |
490 | 472 |
491 for (size_t i = 0; i < string_attributes.size(); ++i) { | 473 for (size_t i = 0; i < string_attributes.size(); ++i) { |
492 std::string value = string_attributes[i].second; | 474 std::string value = string_attributes[i].second; |
493 switch (string_attributes[i].first) { | 475 switch (string_attributes[i].first) { |
494 case AX_ATTR_DOC_URL: | |
495 result += " doc_url=" + value; | |
496 break; | |
497 case AX_ATTR_DOC_TITLE: | |
498 result += " doc_title=" + value; | |
499 break; | |
500 case AX_ATTR_DOC_MIMETYPE: | |
501 result += " doc_mimetype=" + value; | |
502 break; | |
503 case AX_ATTR_DOC_DOCTYPE: | |
504 result += " doc_doctype=" + value; | |
505 break; | |
506 case AX_ATTR_ACCESS_KEY: | 476 case AX_ATTR_ACCESS_KEY: |
507 result += " access_key=" + value; | 477 result += " access_key=" + value; |
508 break; | 478 break; |
509 case AX_ATTR_ACTION: | 479 case AX_ATTR_ACTION: |
510 result += " action=" + value; | 480 result += " action=" + value; |
511 break; | 481 break; |
512 case AX_ATTR_AUTO_COMPLETE: | 482 case AX_ATTR_AUTO_COMPLETE: |
513 result += " autocomplete=" + value; | 483 result += " autocomplete=" + value; |
514 break; | 484 break; |
515 case AX_ATTR_DESCRIPTION: | 485 case AX_ATTR_DESCRIPTION: |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 result += " value=" + value; | 528 result += " value=" + value; |
559 break; | 529 break; |
560 case AX_STRING_ATTRIBUTE_NONE: | 530 case AX_STRING_ATTRIBUTE_NONE: |
561 break; | 531 break; |
562 } | 532 } |
563 } | 533 } |
564 | 534 |
565 for (size_t i = 0; i < float_attributes.size(); ++i) { | 535 for (size_t i = 0; i < float_attributes.size(); ++i) { |
566 std::string value = DoubleToString(float_attributes[i].second); | 536 std::string value = DoubleToString(float_attributes[i].second); |
567 switch (float_attributes[i].first) { | 537 switch (float_attributes[i].first) { |
568 case AX_ATTR_DOC_LOADING_PROGRESS: | |
569 result += " doc_progress=" + value; | |
570 break; | |
571 case AX_ATTR_VALUE_FOR_RANGE: | 538 case AX_ATTR_VALUE_FOR_RANGE: |
572 result += " value_for_range=" + value; | 539 result += " value_for_range=" + value; |
573 break; | 540 break; |
574 case AX_ATTR_MAX_VALUE_FOR_RANGE: | 541 case AX_ATTR_MAX_VALUE_FOR_RANGE: |
575 result += " max_value=" + value; | 542 result += " max_value=" + value; |
576 break; | 543 break; |
577 case AX_ATTR_MIN_VALUE_FOR_RANGE: | 544 case AX_ATTR_MIN_VALUE_FOR_RANGE: |
578 result += " min_value=" + value; | 545 result += " min_value=" + value; |
579 break; | 546 break; |
580 case AX_ATTR_FONT_SIZE: | 547 case AX_ATTR_FONT_SIZE: |
581 result += " font_size=" + value; | 548 result += " font_size=" + value; |
582 break; | 549 break; |
583 case AX_FLOAT_ATTRIBUTE_NONE: | 550 case AX_FLOAT_ATTRIBUTE_NONE: |
584 break; | 551 break; |
585 } | 552 } |
586 } | 553 } |
587 | 554 |
588 for (size_t i = 0; i < bool_attributes.size(); ++i) { | 555 for (size_t i = 0; i < bool_attributes.size(); ++i) { |
589 std::string value = bool_attributes[i].second ? "true" : "false"; | 556 std::string value = bool_attributes[i].second ? "true" : "false"; |
590 switch (bool_attributes[i].first) { | 557 switch (bool_attributes[i].first) { |
591 case AX_ATTR_DOC_LOADED: | |
592 result += " doc_loaded=" + value; | |
593 break; | |
594 case AX_ATTR_BUTTON_MIXED: | 558 case AX_ATTR_BUTTON_MIXED: |
595 result += " mixed=" + value; | 559 result += " mixed=" + value; |
596 break; | 560 break; |
597 case AX_ATTR_LIVE_ATOMIC: | 561 case AX_ATTR_LIVE_ATOMIC: |
598 result += " atomic=" + value; | 562 result += " atomic=" + value; |
599 break; | 563 break; |
600 case AX_ATTR_LIVE_BUSY: | 564 case AX_ATTR_LIVE_BUSY: |
601 result += " busy=" + value; | 565 result += " busy=" + value; |
602 break; | 566 break; |
603 case AX_ATTR_CONTAINER_LIVE_ATOMIC: | 567 case AX_ATTR_CONTAINER_LIVE_ATOMIC: |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 bool AXNodeData::IsRoot() const { | 640 bool AXNodeData::IsRoot() const { |
677 return (role == AX_ROLE_ROOT_WEB_AREA || | 641 return (role == AX_ROLE_ROOT_WEB_AREA || |
678 role == AX_ROLE_DESKTOP); | 642 role == AX_ROLE_DESKTOP); |
679 } | 643 } |
680 | 644 |
681 void AXNodeData::SetRoot() { | 645 void AXNodeData::SetRoot() { |
682 role = AX_ROLE_ROOT_WEB_AREA; | 646 role = AX_ROLE_ROOT_WEB_AREA; |
683 } | 647 } |
684 | 648 |
685 } // namespace ui | 649 } // namespace ui |
OLD | NEW |