| 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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 dst->role == ui::AX_ROLE_ROW_HEADER || | 538 dst->role == ui::AX_ROLE_ROW_HEADER || |
| 539 dst->role == ui::AX_ROLE_COLUMN_HEADER) { | 539 dst->role == ui::AX_ROLE_COLUMN_HEADER) { |
| 540 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_COLUMN_INDEX, | 540 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_COLUMN_INDEX, |
| 541 src.cellColumnIndex()); | 541 src.cellColumnIndex()); |
| 542 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_COLUMN_SPAN, | 542 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_COLUMN_SPAN, |
| 543 src.cellColumnSpan()); | 543 src.cellColumnSpan()); |
| 544 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_ROW_INDEX, src.cellRowIndex()); | 544 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_ROW_INDEX, src.cellRowIndex()); |
| 545 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_ROW_SPAN, src.cellRowSpan()); | 545 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_ROW_SPAN, src.cellRowSpan()); |
| 546 } | 546 } |
| 547 | 547 |
| 548 if ((dst->role == ui::AX_ROLE_ROW_HEADER || |
| 549 dst->role == ui::AX_ROLE_COLUMN_HEADER) && src.sortDirection()) { |
| 550 dst->AddIntAttribute(ui::AX_ATTR_SORT_DIRECTION, |
| 551 AXSortDirectionFromBlink(src.sortDirection())); |
| 552 } |
| 553 |
| 548 dst->AddStringAttribute(ui::AX_ATTR_NAME, name); | 554 dst->AddStringAttribute(ui::AX_ATTR_NAME, name); |
| 549 | 555 |
| 550 // Add the ids of *indirect* children - those who are children of this node, | 556 // Add the ids of *indirect* children - those who are children of this node, |
| 551 // but whose parent is *not* this node. One example is a table | 557 // but whose parent is *not* this node. One example is a table |
| 552 // cell, which is a child of both a row and a column. Because the cell's | 558 // cell, which is a child of both a row and a column. Because the cell's |
| 553 // parent is the row, the row adds it as a child, and the column adds it | 559 // parent is the row, the row adds it as a child, and the column adds it |
| 554 // as an indirect child. | 560 // as an indirect child. |
| 555 int child_count = src.childCount(); | 561 int child_count = src.childCount(); |
| 556 for (int i = 0; i < child_count; ++i) { | 562 for (int i = 0; i < child_count; ++i) { |
| 557 WebAXObject child = src.childAt(i); | 563 WebAXObject child = src.childAt(i); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 AddIntListAttributeFromWebObjects(ui::AX_ATTR_OWNS_IDS, owns, dst); | 595 AddIntListAttributeFromWebObjects(ui::AX_ATTR_OWNS_IDS, owns, dst); |
| 590 } | 596 } |
| 591 | 597 |
| 592 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const { | 598 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const { |
| 593 if (render_frame_ && render_frame_->GetWebFrame()) | 599 if (render_frame_ && render_frame_->GetWebFrame()) |
| 594 return render_frame_->GetWebFrame()->document(); | 600 return render_frame_->GetWebFrame()->document(); |
| 595 return WebDocument(); | 601 return WebDocument(); |
| 596 } | 602 } |
| 597 | 603 |
| 598 } // namespace content | 604 } // namespace content |
| OLD | NEW |