Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(604)

Unified Diff: ui/accessibility/ax_tree.cc

Issue 116293005: Refactor content/ to use ui::AXNodeData instead of blink. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update content/DEPS instead of subdirs Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/accessibility/ax_tree.h ('k') | ui/accessibility/ax_tree_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/accessibility/ax_tree.cc
diff --git a/ui/accessibility/ax_tree.cc b/ui/accessibility/ax_tree.cc
index 5edb649ae85ef0536d777e2022988508138adee8..51aa13ff8ca113f42c575ffed6324e801ae90e97 100644
--- a/ui/accessibility/ax_tree.cc
+++ b/ui/accessibility/ax_tree.cc
@@ -12,6 +12,20 @@
namespace ui {
+namespace {
+
+std::string TreeToStringHelper(AXNode* node, int indent) {
+ std::string result;
+ for (int i = 0; i < indent; i++)
+ result += " ";
+ result += node->data().ToString() + "\n";
+ for (int i = 0; i < node->child_count(); ++i)
+ result += TreeToStringHelper(node->ChildAtIndex(i), indent + 1);
+ return result;
+}
+
+} // anonymous namespace
+
AXTree::AXTree()
: root_(NULL) {
AXNodeData root;
@@ -81,6 +95,10 @@ bool AXTree::Unserialize(const AXTreeUpdate& update) {
return true;
}
+std::string AXTree::ToString() const {
+ return TreeToStringHelper(root_, 0);
+}
+
AXNode* AXTree::CreateNode(AXNode* parent, int32 id, int32 index_in_parent) {
return new AXNode(parent, id, index_in_parent);
}
« no previous file with comments | « ui/accessibility/ax_tree.h ('k') | ui/accessibility/ax_tree_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698