5#ifndef UI_ACCESSIBILITY_AX_TREE_UPDATE_H_
6#define UI_ACCESSIBILITY_AX_TREE_UPDATE_H_
11#include <unordered_map>
51template <
typename AXNodeData,
typename AXTreeData>
88template <
typename AXNodeData,
typename AXTreeData>
93 result +=
"AXTreeUpdate tree data:" + tree_data.ToString() +
"\n";
97 result +=
"AXTreeUpdate: clear node " +
108 if (!event_intents.empty()) {
109 result +=
"event_intents=[\n";
110 for (
const auto& event_intent : event_intents)
111 result +=
" " + event_intent.ToString() +
"\n";
120 std::unordered_map<int32_t, int> id_to_indentation;
121 for (
size_t i = 0;
i < nodes.size(); ++
i) {
122 int indent = id_to_indentation[nodes[
i].id];
123 result += std::string(2 * indent,
' ');
124 result += nodes[
i].ToString() +
"\n";
125 for (
size_t j = 0; j < nodes[
i].child_ids.size(); ++j)
126 id_to_indentation[nodes[
i].child_ids[j]] = indent + 1;
136template <
typename AXNodeData,
typename AXTreeData>
static constexpr AXID kInvalidAXID
std::string NumberToString(int32_t number)
bool TreeUpdatesCanBeMerged(const AXTreeUpdateBase< AXNodeData, AXTreeData > &u1, const AXTreeUpdateBase< AXNodeData, AXTreeData > &u2)
const char * ToString(ax::mojom::Event event)
ax::mojom::EventFrom event_from
std::vector< AXEventIntent > event_intents
std::string ToString() const
std::vector< AXNodeData > nodes