#include "services/screen_ai/proto/main_content_extractor_proto_convertor.h"
#include "base/check_op.h"
#include "base/containers/contains.h"
#include "base/containers/fixed_flat_map.h"
#include "base/containers/fixed_flat_set.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "services/screen_ai/proto/view_hierarchy.pb.h"
#include "ui/accessibility/accessibility_features.h"
#include "ui/accessibility/ax_enum_util.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/accessibility/ax_node.h"
#include "ui/accessibility/ax_tree.h"
#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/geometry/size_f.h"
namespace {
void AddAttribute(const std::string& name,
bool value,
screenai::UiElement& ui_element) { … }
void AddAttribute(const std::string& name,
int value,
screenai::UiElement& ui_element) { … }
void AddAttribute(const std::string& name,
float value,
screenai::UiElement& ui_element) { … }
template <class T>
void AddAttribute(const std::string& name,
const T& value,
screenai::UiElement& ui_element) { … }
screenai::UiElement CreateUiElementProto(const ui::AXTree& tree,
const ui::AXNode* node,
int id,
int parent_id,
gfx::SizeF& tree_dimensions) { … }
void AddSubTree(const ui::AXTree& tree,
const ui::AXNode* node,
screenai::ViewHierarchy& proto,
int& next_unused_node_id,
int parent_id,
gfx::SizeF& tree_dimensions) { … }
}
namespace screen_ai {
std::optional<ViewHierarchyAndTreeSize> SnapshotToViewHierarchy(
const ui::AXTree& tree) { … }
}