Commit fb6cb385 authored by Alexander Surkov's avatar Alexander Surkov Committed by Chromium LUCI CQ

a11y inspect reorg: get rid of AccessibilityTreeFormatterBase::DumpAccessibilityTreeFromManager

DumpAccessibilityTreeFromManager is small and has only one consumer: web_contents, which can use tree formatters directly.

Bug: 1133330
Change-Id: I76aba176ec5a240fcfe1b1fe00742ac52880dafe
AX-Relnotes: n/a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2532669
Commit-Queue: Alexander Surkov <asurkov@igalia.com>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#832341}
parent 4075a582
...@@ -35,22 +35,6 @@ const char kSkipChildren[] = "@NO_CHILDREN_DUMP"; ...@@ -35,22 +35,6 @@ const char kSkipChildren[] = "@NO_CHILDREN_DUMP";
} // namespace } // namespace
// static
std::string AccessibilityTreeFormatterBase::DumpAccessibilityTreeFromManager(
BrowserAccessibilityManager* ax_mgr,
bool internal,
std::vector<AXPropertyFilter> property_filters) {
std::unique_ptr<ui::AXTreeFormatter> formatter =
internal ? AXInspectFactory::CreateBlinkFormatter()
: AXInspectFactory::CreatePlatformFormatter();
formatter->SetPropertyFilters(property_filters);
base::Value dict =
static_cast<AccessibilityTreeFormatterBase*>(formatter.get())
->BuildTree(ax_mgr->GetRoot());
return formatter->FormatTree(dict);
}
AccessibilityTreeFormatterBase::AccessibilityTreeFormatterBase() = default; AccessibilityTreeFormatterBase::AccessibilityTreeFormatterBase() = default;
AccessibilityTreeFormatterBase::~AccessibilityTreeFormatterBase() = default; AccessibilityTreeFormatterBase::~AccessibilityTreeFormatterBase() = default;
......
...@@ -41,11 +41,6 @@ class CONTENT_EXPORT AccessibilityTreeFormatterBase ...@@ -41,11 +41,6 @@ class CONTENT_EXPORT AccessibilityTreeFormatterBase
AccessibilityTreeFormatterBase(); AccessibilityTreeFormatterBase();
~AccessibilityTreeFormatterBase() override; ~AccessibilityTreeFormatterBase() override;
static std::string DumpAccessibilityTreeFromManager(
BrowserAccessibilityManager* ax_mgr,
bool internal,
std::vector<AXPropertyFilter> property_filters);
std::string Format(ui::AXPlatformNodeDelegate* root) const override; std::string Format(ui::AXPlatformNodeDelegate* root) const override;
// Populates the given DictionaryValue with the accessibility tree. // Populates the given DictionaryValue with the accessibility tree.
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
#include "components/rappor/public/rappor_utils.h" #include "components/rappor/public/rappor_utils.h"
#include "components/url_formatter/url_formatter.h" #include "components/url_formatter/url_formatter.h"
#include "content/browser/accessibility/accessibility_event_recorder.h" #include "content/browser/accessibility/accessibility_event_recorder.h"
#include "content/browser/accessibility/accessibility_tree_formatter_blink.h" #include "content/browser/accessibility/browser_accessibility.h"
#include "content/browser/bad_message.h" #include "content/browser/bad_message.h"
#include "content/browser/browser_main_loop.h" #include "content/browser/browser_main_loop.h"
#include "content/browser/browser_plugin/browser_plugin_embedder.h" #include "content/browser/browser_plugin/browser_plugin_embedder.h"
...@@ -4018,8 +4018,13 @@ std::string WebContentsImpl::DumpAccessibilityTree( ...@@ -4018,8 +4018,13 @@ std::string WebContentsImpl::DumpAccessibilityTree(
OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::DumpAccessibilityTree"); OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::DumpAccessibilityTree");
auto* ax_mgr = GetOrCreateRootBrowserAccessibilityManager(); auto* ax_mgr = GetOrCreateRootBrowserAccessibilityManager();
DCHECK(ax_mgr); DCHECK(ax_mgr);
return AccessibilityTreeFormatterBase::DumpAccessibilityTreeFromManager(
ax_mgr, internal, property_filters); std::unique_ptr<ui::AXTreeFormatter> formatter =
internal ? AXInspectFactory::CreateBlinkFormatter()
: AXInspectFactory::CreatePlatformFormatter();
formatter->SetPropertyFilters(property_filters);
return formatter->Format(ax_mgr->GetRoot());
} }
void WebContentsImpl::RecordAccessibilityEvents( void WebContentsImpl::RecordAccessibilityEvents(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment