| 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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 | 320 |
| 321 if (dst->role == ui::AX_ROLE_HEADING) | 321 if (dst->role == ui::AX_ROLE_HEADING) |
| 322 dst->AddIntAttribute(ui::AX_ATTR_HIERARCHICAL_LEVEL, src.headingLevel()); | 322 dst->AddIntAttribute(ui::AX_ATTR_HIERARCHICAL_LEVEL, src.headingLevel()); |
| 323 else if ((dst->role == ui::AX_ROLE_TREE_ITEM || | 323 else if ((dst->role == ui::AX_ROLE_TREE_ITEM || |
| 324 dst->role == ui::AX_ROLE_ROW) && | 324 dst->role == ui::AX_ROLE_ROW) && |
| 325 src.hierarchicalLevel() > 0) { | 325 src.hierarchicalLevel() > 0) { |
| 326 dst->AddIntAttribute(ui::AX_ATTR_HIERARCHICAL_LEVEL, | 326 dst->AddIntAttribute(ui::AX_ATTR_HIERARCHICAL_LEVEL, |
| 327 src.hierarchicalLevel()); | 327 src.hierarchicalLevel()); |
| 328 } | 328 } |
| 329 | 329 |
| 330 if (src.ariaSetSize() > 0) |
| 331 dst->AddIntAttribute(ui::AX_ATTR_SET_SIZE, src.ariaSetSize()); |
| 332 |
| 333 if (src.ariaPosInSet() > 0) |
| 334 dst->AddIntAttribute(ui::AX_ATTR_POS_IN_SET, src.ariaPosInSet()); |
| 335 |
| 330 // Treat the active list box item as focused. | 336 // Treat the active list box item as focused. |
| 331 if (dst->role == ui::AX_ROLE_LIST_BOX_OPTION && | 337 if (dst->role == ui::AX_ROLE_LIST_BOX_OPTION && |
| 332 src.isSelectedOptionActive()) { | 338 src.isSelectedOptionActive()) { |
| 333 dst->state |= (1 << ui::AX_STATE_FOCUSED); | 339 dst->state |= (1 << ui::AX_STATE_FOCUSED); |
| 334 } | 340 } |
| 335 | 341 |
| 336 if (src.canvasHasFallbackContent()) | 342 if (src.canvasHasFallbackContent()) |
| 337 dst->AddBoolAttribute(ui::AX_ATTR_CANVAS_HAS_FALLBACK, true); | 343 dst->AddBoolAttribute(ui::AX_ATTR_CANVAS_HAS_FALLBACK, true); |
| 338 | 344 |
| 339 WebNode node = src.node(); | 345 WebNode node = src.node(); |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 AddIntListAttributeFromWebObjects(ui::AX_ATTR_OWNS_IDS, owns, dst); | 607 AddIntListAttributeFromWebObjects(ui::AX_ATTR_OWNS_IDS, owns, dst); |
| 602 } | 608 } |
| 603 | 609 |
| 604 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const { | 610 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const { |
| 605 if (render_frame_ && render_frame_->GetWebFrame()) | 611 if (render_frame_ && render_frame_->GetWebFrame()) |
| 606 return render_frame_->GetWebFrame()->document(); | 612 return render_frame_->GetWebFrame()->document(); |
| 607 return WebDocument(); | 613 return WebDocument(); |
| 608 } | 614 } |
| 609 | 615 |
| 610 } // namespace content | 616 } // namespace content |
| OLD | NEW |