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 #include "content/renderer/accessibility/blink_ax_tree_source.h" | 5 #include "content/renderer/accessibility/blink_ax_tree_source.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 ui::AX_ATTR_DESCRIBEDBY_IDS, descriptionObjects, dst); | 414 ui::AX_ATTR_DESCRIBEDBY_IDS, descriptionObjects, dst); |
415 } | 415 } |
416 | 416 |
417 std::string value; | 417 std::string value; |
418 if (src.valueDescription().length()) { | 418 if (src.valueDescription().length()) { |
419 dst->AddStringAttribute(ui::AX_ATTR_VALUE, src.valueDescription().utf8()); | 419 dst->AddStringAttribute(ui::AX_ATTR_VALUE, src.valueDescription().utf8()); |
420 } else { | 420 } else { |
421 dst->AddStringAttribute(ui::AX_ATTR_VALUE, src.stringValue().utf8()); | 421 dst->AddStringAttribute(ui::AX_ATTR_VALUE, src.stringValue().utf8()); |
422 } | 422 } |
423 | 423 |
424 if (src.isButtonStateMixed()) | |
425 dst->AddBoolAttribute(ui::AX_ATTR_STATE_MIXED, true); | |
426 | |
427 if (src.canSetValueAttribute()) | 424 if (src.canSetValueAttribute()) |
428 dst->AddBoolAttribute(ui::AX_ATTR_CAN_SET_VALUE, true); | 425 dst->AddBoolAttribute(ui::AX_ATTR_CAN_SET_VALUE, true); |
429 | 426 |
430 if (!src.url().isEmpty()) | 427 if (!src.url().isEmpty()) |
431 dst->AddStringAttribute(ui::AX_ATTR_URL, src.url().string().utf8()); | 428 dst->AddStringAttribute(ui::AX_ATTR_URL, src.url().string().utf8()); |
432 | 429 |
433 // The following set of attributes are only accessed when the accessibility | 430 // The following set of attributes are only accessed when the accessibility |
434 // mode is set to screen reader mode, otherwise only the more basic | 431 // mode is set to screen reader mode, otherwise only the more basic |
435 // attributes are populated. | 432 // attributes are populated. |
436 if (accessibility_mode_ & ACCESSIBILITY_MODE_FLAG_SCREEN_READER) { | 433 if (accessibility_mode_ & ACCESSIBILITY_MODE_FLAG_SCREEN_READER) { |
(...skipping 30 matching lines...) Expand all Loading... |
467 if (src.invalidState()) { | 464 if (src.invalidState()) { |
468 dst->AddIntAttribute(ui::AX_ATTR_INVALID_STATE, | 465 dst->AddIntAttribute(ui::AX_ATTR_INVALID_STATE, |
469 AXInvalidStateFromBlink(src.invalidState())); | 466 AXInvalidStateFromBlink(src.invalidState())); |
470 } | 467 } |
471 if (src.invalidState() == blink::WebAXInvalidStateOther && | 468 if (src.invalidState() == blink::WebAXInvalidStateOther && |
472 src.ariaInvalidValue().length()) { | 469 src.ariaInvalidValue().length()) { |
473 dst->AddStringAttribute( | 470 dst->AddStringAttribute( |
474 ui::AX_ATTR_ARIA_INVALID_VALUE, src.ariaInvalidValue().utf8()); | 471 ui::AX_ATTR_ARIA_INVALID_VALUE, src.ariaInvalidValue().utf8()); |
475 } | 472 } |
476 | 473 |
| 474 const blink::WebAXCheckedState checkedState = src.checkedState(); |
| 475 if (checkedState) { |
| 476 dst->AddIntAttribute(ui::AX_ATTR_CHECKED_STATE, |
| 477 AXCheckedStateFromBlink(checkedState)); |
| 478 } |
| 479 |
477 if (src.textDirection()) { | 480 if (src.textDirection()) { |
478 dst->AddIntAttribute(ui::AX_ATTR_TEXT_DIRECTION, | 481 dst->AddIntAttribute(ui::AX_ATTR_TEXT_DIRECTION, |
479 AXTextDirectionFromBlink(src.textDirection())); | 482 AXTextDirectionFromBlink(src.textDirection())); |
480 } | 483 } |
481 | 484 |
482 if (src.textStyle()) { | 485 if (src.textStyle()) { |
483 dst->AddIntAttribute(ui::AX_ATTR_TEXT_STYLE, | 486 dst->AddIntAttribute(ui::AX_ATTR_TEXT_STYLE, |
484 AXTextStyleFromBlink(src.textStyle())); | 487 AXTextStyleFromBlink(src.textStyle())); |
485 } | 488 } |
486 | 489 |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 return WebAXObject(); | 864 return WebAXObject(); |
862 | 865 |
863 WebDocument document = render_frame_->GetWebFrame()->document(); | 866 WebDocument document = render_frame_->GetWebFrame()->document(); |
864 if (!document.isNull()) | 867 if (!document.isNull()) |
865 return document.accessibilityObject(); | 868 return document.accessibilityObject(); |
866 | 869 |
867 return WebAXObject(); | 870 return WebAXObject(); |
868 } | 871 } |
869 | 872 |
870 } // namespace content | 873 } // namespace content |
OLD | NEW |