#include "ui/accessibility/platform/inspect/ax_tree_formatter_base.h"
#include "base/containers/contains.h"
#include "base/notreached.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "ui/accessibility/ax_tree_id.h"
#include "ui/accessibility/platform/ax_platform_node_delegate.h"
#include "ui/accessibility/platform/inspect/ax_property_node.h"
namespace ui {
namespace {
const char kIndentSymbol = …;
const int kIndentSymbolCount = …;
const char kSkipString[] = …;
const char kSkipChildren[] = …;
}
AXTreeFormatterBase::AXTreeFormatterBase() = default;
AXTreeFormatterBase::~AXTreeFormatterBase() = default;
const char AXTreeFormatterBase::kChildrenDictAttr[] = …;
bool AXTreeFormatterBase::ShouldDumpNode(
const AXPlatformNodeDelegate& node) const { … }
bool AXTreeFormatterBase::ShouldDumpChildren(
const AXPlatformNodeDelegate& node) const { … }
std::string AXTreeFormatterBase::Format(AXPlatformNodeDelegate* root) const { … }
std::string AXTreeFormatterBase::FormatNode(
AXPlatformNodeDelegate* node) const { … }
base::Value::Dict AXTreeFormatterBase::BuildNode(
AXPlatformNodeDelegate* node) const { … }
std::string AXTreeFormatterBase::FormatTree(
const base::Value::Dict& dict) const { … }
base::Value::Dict AXTreeFormatterBase::BuildTreeForNode(AXNode* root) const { … }
std::string AXTreeFormatterBase::EvaluateScript(
const AXTreeSelector& selector,
const AXInspectScenario& scenario) const { … }
std::string AXTreeFormatterBase::EvaluateScript(
AXPlatformNodeDelegate* root,
const std::vector<AXScriptInstruction>& instructions,
size_t start_index,
size_t end_index) const { … }
void AXTreeFormatterBase::RecursiveFormatTree(const base::Value::Dict& dict,
std::string* contents,
int depth) const { … }
void AXTreeFormatterBase::SetPropertyFilters(
const std::vector<AXPropertyFilter>& property_filters,
PropertyFilterSet default_filter_set) { … }
void AXTreeFormatterBase::SetNodeFilters(
const std::vector<AXNodeFilter>& node_filters) { … }
void AXTreeFormatterBase::set_show_ids(bool show_ids) { … }
std::string AXTreeFormatterBase::DumpInternalAccessibilityTree(
AXTreeID tree_id,
const std::vector<AXPropertyFilter>& property_filters) { … }
std::vector<AXPropertyNode> AXTreeFormatterBase::PropertyFilterNodesFor(
const std::string& line_index) const { … }
std::vector<AXPropertyNode> AXTreeFormatterBase::ScriptPropertyNodes() const { … }
bool AXTreeFormatterBase::HasMatchAllPropertyFilter() const { … }
bool AXTreeFormatterBase::MatchesPropertyFilters(const std::string& text,
bool default_result) const { … }
bool AXTreeFormatterBase::MatchesNodeFilters(
const base::Value::Dict& dict) const { … }
std::string AXTreeFormatterBase::FormatCoordinates(
const base::Value::Dict& dict,
const std::string& name,
const std::string& x_name,
const std::string& y_name) const { … }
std::string AXTreeFormatterBase::FormatRectangle(
const base::Value::Dict& dict,
const std::string& name,
const std::string& left_name,
const std::string& top_name,
const std::string& width_name,
const std::string& height_name) const { … }
bool AXTreeFormatterBase::WriteAttribute(bool include_by_default,
const std::string& attr,
std::string* line) const { … }
void AXTreeFormatterBase::AddPropertyFilter(
std::vector<AXPropertyFilter>* property_filters,
std::string filter,
AXPropertyFilter::Type type) { … }
void AXTreeFormatterBase::AddDefaultFilters(
std::vector<AXPropertyFilter>* property_filters) { … }
}