| 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 | 328 |
| 329 if (dst->role == ui::AX_ROLE_HEADING) | 329 if (dst->role == ui::AX_ROLE_HEADING) |
| 330 dst->AddIntAttribute(ui::AX_ATTR_HIERARCHICAL_LEVEL, src.headingLevel()); | 330 dst->AddIntAttribute(ui::AX_ATTR_HIERARCHICAL_LEVEL, src.headingLevel()); |
| 331 else if ((dst->role == ui::AX_ROLE_TREE_ITEM || | 331 else if ((dst->role == ui::AX_ROLE_TREE_ITEM || |
| 332 dst->role == ui::AX_ROLE_ROW) && | 332 dst->role == ui::AX_ROLE_ROW) && |
| 333 src.hierarchicalLevel() > 0) { | 333 src.hierarchicalLevel() > 0) { |
| 334 dst->AddIntAttribute(ui::AX_ATTR_HIERARCHICAL_LEVEL, | 334 dst->AddIntAttribute(ui::AX_ATTR_HIERARCHICAL_LEVEL, |
| 335 src.hierarchicalLevel()); | 335 src.hierarchicalLevel()); |
| 336 } | 336 } |
| 337 | 337 |
| 338 if (src.setSize()) |
| 339 dst->AddIntAttribute(ui::AX_ATTR_SET_SIZE, src.setSize()); |
| 340 |
| 341 if (src.posInSet()) |
| 342 dst->AddIntAttribute(ui::AX_ATTR_POS_IN_SET, src.posInSet()); |
| 343 |
| 338 // Treat the active list box item as focused. | 344 // Treat the active list box item as focused. |
| 339 if (dst->role == ui::AX_ROLE_LIST_BOX_OPTION && | 345 if (dst->role == ui::AX_ROLE_LIST_BOX_OPTION && |
| 340 src.isSelectedOptionActive()) { | 346 src.isSelectedOptionActive()) { |
| 341 dst->state |= (1 << ui::AX_STATE_FOCUSED); | 347 dst->state |= (1 << ui::AX_STATE_FOCUSED); |
| 342 } | 348 } |
| 343 | 349 |
| 344 if (src.canvasHasFallbackContent()) | 350 if (src.canvasHasFallbackContent()) |
| 345 dst->AddBoolAttribute(ui::AX_ATTR_CANVAS_HAS_FALLBACK, true); | 351 dst->AddBoolAttribute(ui::AX_ATTR_CANVAS_HAS_FALLBACK, true); |
| 346 | 352 |
| 347 WebNode node = src.node(); | 353 WebNode node = src.node(); |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 AddIntListAttributeFromWebObjects(ui::AX_ATTR_OWNS_IDS, owns, dst); | 613 AddIntListAttributeFromWebObjects(ui::AX_ATTR_OWNS_IDS, owns, dst); |
| 608 } | 614 } |
| 609 | 615 |
| 610 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const { | 616 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const { |
| 611 if (render_frame_ && render_frame_->GetWebFrame()) | 617 if (render_frame_ && render_frame_->GetWebFrame()) |
| 612 return render_frame_->GetWebFrame()->document(); | 618 return render_frame_->GetWebFrame()->document(); |
| 613 return WebDocument(); | 619 return WebDocument(); |
| 614 } | 620 } |
| 615 | 621 |
| 616 } // namespace content | 622 } // namespace content |
| OLD | NEW |