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

Side by Side Diff: ui/accessibility/ax_tree.cc

Issue 236203015: Add ToString to AXTreeUpdate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nicer indent Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/accessibility/ax_node_data.cc ('k') | ui/accessibility/ax_tree_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ui/accessibility/ax_tree.h" 5 #include "ui/accessibility/ax_tree.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
11 #include "ui/accessibility/ax_node.h" 11 #include "ui/accessibility/ax_node.h"
12 12
13 namespace ui { 13 namespace ui {
14 14
15 namespace { 15 namespace {
16 16
17 std::string TreeToStringHelper(AXNode* node, int indent) { 17 std::string TreeToStringHelper(AXNode* node, int indent) {
18 std::string result; 18 std::string result = std::string(2 * indent, ' ');
19 for (int i = 0; i < indent; i++)
20 result += " ";
21 result += node->data().ToString() + "\n"; 19 result += node->data().ToString() + "\n";
22 for (int i = 0; i < node->child_count(); ++i) 20 for (int i = 0; i < node->child_count(); ++i)
23 result += TreeToStringHelper(node->ChildAtIndex(i), indent + 1); 21 result += TreeToStringHelper(node->ChildAtIndex(i), indent + 1);
24 return result; 22 return result;
25 } 23 }
26 24
27 } // anonymous namespace 25 } // anonymous namespace
28 26
29 // Intermediate state to keep track of during a tree update. 27 // Intermediate state to keep track of during a tree update.
30 struct AXTreeUpdateState { 28 struct AXTreeUpdateState {
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 update_state->pending_nodes.insert(child); 255 update_state->pending_nodes.insert(child);
258 update_state->new_nodes.insert(child); 256 update_state->new_nodes.insert(child);
259 } 257 }
260 new_children->push_back(child); 258 new_children->push_back(child);
261 } 259 }
262 260
263 return success; 261 return success;
264 } 262 }
265 263
266 } // namespace ui 264 } // namespace ui
OLDNEW
« no previous file with comments | « ui/accessibility/ax_node_data.cc ('k') | ui/accessibility/ax_tree_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698