| 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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 dst->AddIntAttribute(ui::AX_ATTR_INVALID_STATE, | 487 dst->AddIntAttribute(ui::AX_ATTR_INVALID_STATE, |
| 488 AXInvalidStateFromBlink(src.InvalidState())); | 488 AXInvalidStateFromBlink(src.InvalidState())); |
| 489 } | 489 } |
| 490 if (src.InvalidState() == blink::kWebAXInvalidStateOther && | 490 if (src.InvalidState() == blink::kWebAXInvalidStateOther && |
| 491 src.AriaInvalidValue().length()) { | 491 src.AriaInvalidValue().length()) { |
| 492 dst->AddStringAttribute(ui::AX_ATTR_ARIA_INVALID_VALUE, | 492 dst->AddStringAttribute(ui::AX_ATTR_ARIA_INVALID_VALUE, |
| 493 src.AriaInvalidValue().Utf8()); | 493 src.AriaInvalidValue().Utf8()); |
| 494 } | 494 } |
| 495 | 495 |
| 496 if (src.IsCheckable()) { | 496 if (src.IsCheckable()) { |
| 497 const blink::WebAXCheckedState checked_state = src.CheckedState(); | 497 const blink::WebAXButtonState checked_state = src.CheckedState(); |
| 498 dst->AddIntAttribute(ui::AX_ATTR_CHECKED_STATE, | 498 dst->AddIntAttribute(ui::AX_ATTR_CHECKED_STATE, |
| 499 AXCheckedStateFromBlink(checked_state)); | 499 AXButtonStateFromBlink(checked_state)); |
| 500 } |
| 501 |
| 502 if (dst->role == ui::AX_ROLE_TOGGLE_BUTTON) { |
| 503 const blink::WebAXButtonState pressed_state = src.PressedState(); |
| 504 dst->AddIntAttribute(ui::AX_ATTR_PRESSED_STATE, |
| 505 AXButtonStateFromBlink(pressed_state)); |
| 500 } | 506 } |
| 501 | 507 |
| 502 if (src.GetTextDirection()) { | 508 if (src.GetTextDirection()) { |
| 503 dst->AddIntAttribute(ui::AX_ATTR_TEXT_DIRECTION, | 509 dst->AddIntAttribute(ui::AX_ATTR_TEXT_DIRECTION, |
| 504 AXTextDirectionFromBlink(src.GetTextDirection())); | 510 AXTextDirectionFromBlink(src.GetTextDirection())); |
| 505 } | 511 } |
| 506 | 512 |
| 507 if (src.TextStyle()) { | 513 if (src.TextStyle()) { |
| 508 dst->AddIntAttribute(ui::AX_ATTR_TEXT_STYLE, | 514 dst->AddIntAttribute(ui::AX_ATTR_TEXT_STYLE, |
| 509 AXTextStyleFromBlink(src.TextStyle())); | 515 AXTextStyleFromBlink(src.TextStyle())); |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 return WebAXObject(); | 894 return WebAXObject(); |
| 889 | 895 |
| 890 WebDocument document = render_frame_->GetWebFrame()->GetDocument(); | 896 WebDocument document = render_frame_->GetWebFrame()->GetDocument(); |
| 891 if (!document.IsNull()) | 897 if (!document.IsNull()) |
| 892 return document.AccessibilityObject(); | 898 return document.AccessibilityObject(); |
| 893 | 899 |
| 894 return WebAXObject(); | 900 return WebAXObject(); |
| 895 } | 901 } |
| 896 | 902 |
| 897 } // namespace content | 903 } // namespace content |
| OLD | NEW |