| 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 <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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 dst->AddIntListAttribute(ui::AX_ATTR_LINE_BREAKS, line_breaks); | 371 dst->AddIntListAttribute(ui::AX_ATTR_LINE_BREAKS, line_breaks); |
| 372 } | 372 } |
| 373 | 373 |
| 374 if (dst->role == ui::AX_ROLE_TEXT_FIELD && | 374 if (dst->role == ui::AX_ROLE_TEXT_FIELD && |
| 375 src.textInputType().length()) { | 375 src.textInputType().length()) { |
| 376 dst->AddStringAttribute(ui::AX_ATTR_TEXT_INPUT_TYPE, | 376 dst->AddStringAttribute(ui::AX_ATTR_TEXT_INPUT_TYPE, |
| 377 UTF16ToUTF8(src.textInputType())); | 377 UTF16ToUTF8(src.textInputType())); |
| 378 } | 378 } |
| 379 } | 379 } |
| 380 | 380 |
| 381 blink::WebAXOptionalBool optionalBool = src.isAriaGrabbed(); |
| 382 if (optionalBool == blink::WebAXOptionalBoolFalse) |
| 383 dst->AddBoolAttribute(ui::AX_ATTR_GRABBED, false); |
| 384 else if (optionalBool == blink::WebAXOptionalBoolTrue) |
| 385 dst->AddBoolAttribute(ui::AX_ATTR_GRABBED, true); |
| 386 |
| 381 // ARIA role. | 387 // ARIA role. |
| 382 if (element.hasAttribute("role")) { | 388 if (element.hasAttribute("role")) { |
| 383 dst->AddStringAttribute(ui::AX_ATTR_ROLE, | 389 dst->AddStringAttribute(ui::AX_ATTR_ROLE, |
| 384 UTF16ToUTF8(element.getAttribute("role"))); | 390 UTF16ToUTF8(element.getAttribute("role"))); |
| 385 } else { | 391 } else { |
| 386 std::string role = GetEquivalentAriaRoleString(dst->role); | 392 std::string role = GetEquivalentAriaRoleString(dst->role); |
| 387 if (!role.empty()) | 393 if (!role.empty()) |
| 388 dst->AddStringAttribute(ui::AX_ATTR_ROLE, role); | 394 dst->AddStringAttribute(ui::AX_ATTR_ROLE, role); |
| 389 } | 395 } |
| 390 | 396 |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 AddIntListAttributeFromWebObjects(ui::AX_ATTR_OWNS_IDS, owns, dst); | 590 AddIntListAttributeFromWebObjects(ui::AX_ATTR_OWNS_IDS, owns, dst); |
| 585 } | 591 } |
| 586 | 592 |
| 587 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const { | 593 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const { |
| 588 if (render_frame_ && render_frame_->GetWebFrame()) | 594 if (render_frame_ && render_frame_->GetWebFrame()) |
| 589 return render_frame_->GetWebFrame()->document(); | 595 return render_frame_->GetWebFrame()->document(); |
| 590 return WebDocument(); | 596 return WebDocument(); |
| 591 } | 597 } |
| 592 | 598 |
| 593 } // namespace content | 599 } // namespace content |
| OLD | NEW |