OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/strings/string_number_conversions.h" | 5 #include "base/strings/string_number_conversions.h" |
6 #include "content/common/ax_content_node_data.h" | 6 #include "content/common/ax_content_node_data.h" |
7 | 7 |
8 using base::IntToString; | 8 using base::IntToString; |
9 | 9 |
10 namespace content { | 10 namespace content { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 AXContentIntAttribute attribute, int32 value) { | 62 AXContentIntAttribute attribute, int32 value) { |
63 content_int_attributes.push_back(std::make_pair(attribute, value)); | 63 content_int_attributes.push_back(std::make_pair(attribute, value)); |
64 } | 64 } |
65 | 65 |
66 std::string AXContentNodeData::ToString() const { | 66 std::string AXContentNodeData::ToString() const { |
67 std::string result = AXNodeData::ToString(); | 67 std::string result = AXNodeData::ToString(); |
68 | 68 |
69 for (auto iter : content_int_attributes) { | 69 for (auto iter : content_int_attributes) { |
70 std::string value = IntToString(iter.second); | 70 std::string value = IntToString(iter.second); |
71 switch (iter.first) { | 71 switch (iter.first) { |
72 case AX_CONTENT_ATTR_ROUTING_ID: | |
73 result += " routing_id=" + value; | |
74 break; | |
75 case AX_CONTENT_ATTR_PARENT_ROUTING_ID: | |
76 result += " parent_routing_id=" + value; | |
77 break; | |
78 case AX_CONTENT_ATTR_CHILD_ROUTING_ID: | 72 case AX_CONTENT_ATTR_CHILD_ROUTING_ID: |
79 result += " child_routing_id=" + value; | 73 result += " child_routing_id=" + value; |
80 break; | 74 break; |
81 case AX_CONTENT_ATTR_CHILD_BROWSER_PLUGIN_INSTANCE_ID: | 75 case AX_CONTENT_ATTR_CHILD_BROWSER_PLUGIN_INSTANCE_ID: |
82 result += " child_browser_plugin_instance_id=" + value; | 76 result += " child_browser_plugin_instance_id=" + value; |
83 break; | 77 break; |
84 case AX_CONTENT_INT_ATTRIBUTE_LAST: | 78 case AX_CONTENT_INT_ATTRIBUTE_LAST: |
85 NOTREACHED(); | 79 NOTREACHED(); |
86 break; | 80 break; |
87 } | 81 } |
88 } | 82 } |
89 | 83 |
90 return result; | 84 return result; |
91 } | 85 } |
92 | 86 |
| 87 AXContentTreeData::AXContentTreeData() |
| 88 : routing_id(-1), |
| 89 parent_routing_id(-1) { |
| 90 } |
| 91 |
| 92 AXContentTreeData::~AXContentTreeData() { |
| 93 } |
| 94 |
| 95 std::string AXContentTreeData::ToString() const { |
| 96 std::string result = AXTreeData::ToString(); |
| 97 |
| 98 if (routing_id != -1) |
| 99 result += " routing_id=" + IntToString(routing_id); |
| 100 if (parent_routing_id != -1) |
| 101 result += " parent_routing_id=" + IntToString(parent_routing_id); |
| 102 |
| 103 return result; |
| 104 } |
| 105 |
93 } // namespace ui | 106 } // namespace ui |
OLD | NEW |