#include "content/public/browser/ax_inspect_factory.h"
#include "base/notreached.h"
#include "content/browser/accessibility/accessibility_tree_formatter_blink.h"
#include "ui/accessibility/ax_tree_manager.h"
#include "ui/base/buildflags.h"
namespace content {
std::unique_ptr<ui::AXTreeFormatter> AXInspectFactory::CreateBlinkFormatter() { … }
std::unique_ptr<ui::AXTreeFormatter>
AXInspectFactory::CreatePlatformFormatter() { … }
std::unique_ptr<ui::AXEventRecorder> AXInspectFactory::CreatePlatformRecorder(
ui::AXPlatformTreeManager* manager,
base::ProcessId pid,
const ui::AXTreeSelector& selector) { … }
#if !BUILDFLAG(HAS_PLATFORM_ACCESSIBILITY_SUPPORT) || BUILDFLAG(IS_IOS)
ui::AXApiType::Type AXInspectFactory::DefaultPlatformFormatterType() {
return ui::AXApiType::kBlink;
}
ui::AXApiType::Type AXInspectFactory::DefaultPlatformRecorderType() {
return ui::AXApiType::kBlink;
}
std::unique_ptr<ui::AXTreeFormatter> AXInspectFactory::CreateFormatter(
ui::AXApiType::Type type) {
ui::AXTreeManager::AlwaysFailFast();
switch (type) {
case ui::AXApiType::kBlink:
return std::make_unique<AccessibilityTreeFormatterBlink>();
default:
NOTREACHED_IN_MIGRATION()
<< "Unsupported API type " << static_cast<std::string>(type);
}
return nullptr;
}
std::unique_ptr<ui::AXEventRecorder> AXInspectFactory::CreateRecorder(
ui::AXApiType::Type type,
ui::AXPlatformTreeManager* manager,
base::ProcessId pid,
const ui::AXTreeSelector& selector) {
ui::AXTreeManager::AlwaysFailFast();
DUMP_WILL_BE_NOTREACHED()
<< "Unsupported API type " << static_cast<std::string>(type);
return nullptr;
}
std::vector<ui::AXApiType::Type> AXInspectFactory::SupportedApis() {
return {ui::AXApiType::kBlink};
}
#endif
}