summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/browser/accessibility
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/chrome/browser/accessibility')
-rw-r--r--chromium/chrome/browser/accessibility/accessibility_extension_api.h5
-rw-r--r--chromium/chrome/browser/accessibility/accessibility_labels_service.cc1
-rw-r--r--chromium/chrome/browser/accessibility/accessibility_ui.cc256
-rw-r--r--chromium/chrome/browser/accessibility/image_annotation_browsertest.cc24
-rw-r--r--chromium/chrome/browser/accessibility/interstitial_accessibility_browsertest.cc1
5 files changed, 203 insertions, 84 deletions
diff --git a/chromium/chrome/browser/accessibility/accessibility_extension_api.h b/chromium/chrome/browser/accessibility/accessibility_extension_api.h
index 4f195349f66..dd8e9d611b2 100644
--- a/chromium/chrome/browser/accessibility/accessibility_extension_api.h
+++ b/chromium/chrome/browser/accessibility/accessibility_extension_api.h
@@ -6,11 +6,8 @@
#define CHROME_BROWSER_ACCESSIBILITY_ACCESSIBILITY_EXTENSION_API_H_
#include <string>
-#include "base/compiler_specific.h"
-#include "base/memory/singleton.h"
-#include "base/values.h"
+
#include "extensions/browser/extension_function.h"
-#include "ui/accessibility/ax_enums.mojom.h"
// API function that enables or disables web content accessibility support.
class AccessibilityPrivateSetNativeAccessibilityEnabledFunction
diff --git a/chromium/chrome/browser/accessibility/accessibility_labels_service.cc b/chromium/chrome/browser/accessibility/accessibility_labels_service.cc
index 87859f2f990..4a820e711b4 100644
--- a/chromium/chrome/browser/accessibility/accessibility_labels_service.cc
+++ b/chromium/chrome/browser/accessibility/accessibility_labels_service.cc
@@ -16,6 +16,7 @@
#include "content/public/browser/browser_accessibility_state.h"
#include "content/public/common/content_features.h"
#include "ui/accessibility/ax_action_data.h"
+#include "ui/accessibility/ax_enums.mojom.h"
#if !defined(OS_ANDROID)
#include "chrome/browser/ui/browser.h"
diff --git a/chromium/chrome/browser/accessibility/accessibility_ui.cc b/chromium/chrome/browser/accessibility/accessibility_ui.cc
index efa616a3309..6bdee078155 100644
--- a/chromium/chrome/browser/accessibility/accessibility_ui.cc
+++ b/chromium/chrome/browser/accessibility/accessibility_ui.cc
@@ -5,22 +5,27 @@
#include "chrome/browser/accessibility/accessibility_ui.h"
#include <memory>
+#include <string>
#include <utility>
+#include <vector>
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/command_line.h"
#include "base/json/json_writer.h"
+#include "base/strings/pattern.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "build/build_config.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/chrome_features.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/grit/browser_resources.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_service.h"
+#include "content/public/browser/accessibility_tree_formatter.h"
#include "content/public/browser/browser_accessibility_state.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/favicon_status.h"
@@ -45,29 +50,42 @@
static const char kTargetsDataFile[] = "targets-data.json";
+static const char kAccessibilityModeField[] = "a11yMode";
+static const char kBrowsersField[] = "browsers";
+static const char kEnabledField[] = "enabled";
+static const char kErrorField[] = "error";
+static const char kFaviconUrlField[] = "faviconUrl";
+static const char kFlagNameField[] = "flagName";
+static const char kModeIdField[] = "modeId";
+static const char kNameField[] = "name";
+static const char kPagesField[] = "pages";
+static const char kPidField[] = "pid";
static const char kProcessIdField[] = "processId";
+static const char kRequestTypeField[] = "requestType";
static const char kRouteIdField[] = "routeId";
static const char kSessionIdField[] = "sessionId";
-static const char kUrlField[] = "url";
-static const char kNameField[] = "name";
-static const char kFaviconUrlField[] = "favicon_url";
-static const char kPidField[] = "pid";
-static const char kAccessibilityModeField[] = "a11y_mode";
+static const char kShouldRequestTreeField[] = "shouldRequestTree";
+static const char kTreeField[] = "tree";
static const char kTypeField[] = "type";
+static const char kUrlField[] = "url";
// Global flags
+static const char kBrowser[] = "browser";
+static const char kCopyTree[] = "copyTree";
+static const char kHTML[] = "html";
static const char kInternal[] = "internal";
+static const char kLabelImages[] = "labelImages";
static const char kNative[] = "native";
-static const char kWeb[] = "web";
-static const char kText[] = "text";
+static const char kPage[] = "page";
static const char kScreenReader[] = "screenreader";
-static const char kHTML[] = "html";
-static const char kLabelImages[] = "label_images";
+static const char kShowOrRefreshTree[] = "showOrRefreshTree";
+static const char kText[] = "text";
+static const char kWeb[] = "web";
// Possible global flag values
+static const char kDisabled[] = "disabled";
static const char kOff[] = "off";
static const char kOn[] = "on";
-static const char kDisabled[] = "disabled";
namespace {
@@ -88,7 +106,7 @@ std::unique_ptr<base::DictionaryValue> BuildTargetDescriptor(
target_data->SetInteger(kPidField, base::GetProcId(handle));
target_data->SetString(kFaviconUrlField, favicon_url.spec());
target_data->SetInteger(kAccessibilityModeField, accessibility_mode.mode());
- target_data->SetString(kTypeField, "page");
+ target_data->SetString(kTypeField, kPage);
return target_data;
}
@@ -130,7 +148,7 @@ std::unique_ptr<base::DictionaryValue> BuildTargetDescriptor(Browser* browser) {
target_data->SetInteger(kSessionIdField, browser->session_id().id());
target_data->SetString(kNameField,
browser->GetWindowTitleForCurrentTab(false));
- target_data->SetString(kTypeField, "browser");
+ target_data->SetString(kTypeField, kBrowser);
return target_data;
}
#endif // !defined(OS_ANDROID)
@@ -171,7 +189,7 @@ void HandleAccessibilityRequestCallback(
is_web_enabled ? (screenreader ? kOn : kOff) : kDisabled);
data.SetString(kHTML, is_web_enabled ? (html ? kOn : kOff) : kDisabled);
- // The "label_images" flag works only if "web" is enabled, the current profile
+ // The "labelImages" flag works only if "web" is enabled, the current profile
// has the kAccessibilityImageLabelsEnabled preference set and the appropriate
// command line switch has been used.
bool are_accessibility_image_labels_enabled =
@@ -216,7 +234,7 @@ void HandleAccessibilityRequestCallback(
are_accessibility_image_labels_enabled);
rvh_list->Append(std::move(descriptor));
}
- data.Set("pages", std::move(rvh_list));
+ data.Set(kPagesField, std::move(rvh_list));
std::unique_ptr<base::ListValue> browser_list(new base::ListValue());
#if !defined(OS_ANDROID)
@@ -224,7 +242,7 @@ void HandleAccessibilityRequestCallback(
browser_list->Append(BuildTargetDescriptor(browser));
}
#endif // !defined(OS_ANDROID)
- data.Set("browsers", std::move(browser_list));
+ data.Set(kBrowsersField, std::move(browser_list));
std::string json_string;
base::JSONWriter::Write(data, &json_string);
@@ -232,21 +250,77 @@ void HandleAccessibilityRequestCallback(
callback.Run(base::RefCountedString::TakeString(&json_string));
}
-std::string RecursiveDumpAXPlatformNodeAsString(ui::AXPlatformNode* node,
- int indent) {
+bool MatchesPropertyFilters(
+ const std::vector<content::AccessibilityTreeFormatter::PropertyFilter>&
+ property_filters,
+ const base::string16& text) {
+ bool allow = false;
+ for (const auto& filter : property_filters) {
+ if (base::MatchPattern(text, filter.match_str)) {
+ switch (filter.type) {
+ case content::AccessibilityTreeFormatter::PropertyFilter::ALLOW_EMPTY:
+ allow = true;
+ break;
+ case content::AccessibilityTreeFormatter::PropertyFilter::ALLOW:
+ allow = (!base::MatchPattern(text, base::UTF8ToUTF16("*=''")));
+ break;
+ case content::AccessibilityTreeFormatter::PropertyFilter::DENY:
+ allow = false;
+ break;
+ }
+ }
+ }
+ return allow;
+}
+
+std::string RecursiveDumpAXPlatformNodeAsString(
+ ui::AXPlatformNode* node,
+ int indent,
+ const std::vector<content::AccessibilityTreeFormatter::PropertyFilter>&
+ property_filters) {
if (!node)
return "";
std::string str(2 * indent, '+');
- str += node->GetDelegate()->GetData().ToString() + "\n";
+ std::string line = node->GetDelegate()->GetData().ToString();
+ std::vector<std::string> attributes = base::SplitString(
+ line, " ", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
+ for (std::string attribute : attributes) {
+ if (MatchesPropertyFilters(property_filters,
+ base::UTF8ToUTF16(attribute))) {
+ str += attribute + " ";
+ }
+ }
+ str += "\n";
for (int i = 0; i < node->GetDelegate()->GetChildCount(); i++) {
gfx::NativeViewAccessible child = node->GetDelegate()->ChildAtIndex(i);
ui::AXPlatformNode* child_node =
ui::AXPlatformNode::FromNativeViewAccessible(child);
- str += RecursiveDumpAXPlatformNodeAsString(child_node, indent + 1);
+ str += RecursiveDumpAXPlatformNodeAsString(child_node, indent + 1,
+ property_filters);
}
return str;
}
+// Add property filters to the property_filters vector for the given property
+// filter type. The attributes are passed in as a string with each attribute
+// separated by a space.
+void AddPropertyFilters(
+ std::vector<content::AccessibilityTreeFormatter::PropertyFilter>&
+ property_filters,
+ const std::string& attributes,
+ content::AccessibilityTreeFormatter::PropertyFilter::Type type) {
+ for (const std::string& attribute : base::SplitString(
+ attributes, " ", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY)) {
+ property_filters.push_back(
+ content::AccessibilityTreeFormatter::PropertyFilter(
+ base::ASCIIToUTF16(attribute), type));
+ }
+}
+
+bool IsValidJSValue(const std::string* str) {
+ return str && str->length() < 5000U;
+}
+
} // namespace
AccessibilityUI::AccessibilityUI(content::WebUI* web_ui)
@@ -302,22 +376,13 @@ void AccessibilityUIMessageHandler::RegisterMessages() {
void AccessibilityUIMessageHandler::ToggleAccessibility(
const base::ListValue* args) {
- std::string process_id_str;
- std::string route_id_str;
- std::string should_request_tree_str;
- int process_id;
- int route_id;
- int mode;
- bool should_request_tree;
- CHECK_EQ(4U, args->GetSize());
- CHECK(args->GetString(0, &process_id_str));
- CHECK(args->GetString(1, &route_id_str));
- // TODO(695247): We should pass each ax flag seperately
- CHECK(args->GetInteger(2, &mode));
- CHECK(args->GetString(3, &should_request_tree_str));
- CHECK(base::StringToInt(process_id_str, &process_id));
- CHECK(base::StringToInt(route_id_str, &route_id));
- should_request_tree = (should_request_tree_str == "true");
+ const base::DictionaryValue* data;
+ CHECK(args->GetDictionary(0, &data));
+
+ int process_id = *data->FindIntPath(kProcessIdField);
+ int route_id = *data->FindIntPath(kRouteIdField);
+ int mode = *data->FindIntPath(kModeIdField);
+ bool should_request_tree = *data->FindBoolPath(kShouldRequestTreeField);
AllowJavascript();
content::RenderViewHost* rvh =
@@ -349,26 +414,31 @@ void AccessibilityUIMessageHandler::ToggleAccessibility(
web_contents->SetAccessibilityMode(current_mode);
if (should_request_tree) {
+ base::DictionaryValue request_data;
+ request_data.SetIntPath(kProcessIdField, process_id);
+ request_data.SetIntPath(kRouteIdField, route_id);
+ request_data.SetStringPath(kRequestTypeField, kShowOrRefreshTree);
base::ListValue request_args;
- request_args.Append(std::make_unique<base::Value>(process_id_str));
- request_args.Append(std::make_unique<base::Value>(route_id_str));
- request_args.Append(std::make_unique<base::Value>("showTree"));
+ request_args.Append(std::move(request_data));
RequestWebContentsTree(&request_args);
} else {
- // Call accessibility.showTree without a 'tree' field so the row's
+ // Call accessibility.showOrRefreshTree without a 'tree' field so the row's
// accessibility mode buttons are updated.
AllowJavascript();
std::unique_ptr<base::DictionaryValue> new_mode(BuildTargetDescriptor(rvh));
- CallJavascriptFunction("accessibility.showTree", *(new_mode.get()));
+ CallJavascriptFunction("accessibility.showOrRefreshTree",
+ *(new_mode.get()));
}
}
void AccessibilityUIMessageHandler::SetGlobalFlag(const base::ListValue* args) {
- std::string flag_name_str;
- bool enabled;
- CHECK_EQ(2U, args->GetSize());
- CHECK(args->GetString(0, &flag_name_str));
- CHECK(args->GetBoolean(1, &enabled));
+ const base::DictionaryValue* data;
+ CHECK(args->GetDictionary(0, &data));
+
+ const std::string* flag_name_str_p = data->FindStringPath(kFlagNameField);
+ CHECK(IsValidJSValue(flag_name_str_p));
+ std::string flag_name_str = *flag_name_str_p;
+ bool enabled = *data->FindBoolPath(kEnabledField);
AllowJavascript();
if (flag_name_str == kInternal) {
@@ -422,20 +492,28 @@ void AccessibilityUIMessageHandler::SetGlobalFlag(const base::ListValue* args) {
void AccessibilityUIMessageHandler::RequestWebContentsTree(
const base::ListValue* args) {
- std::string process_id_str;
- std::string route_id_str;
- int process_id;
- int route_id;
- std::string request_type;
- CHECK_EQ(3U, args->GetSize());
- CHECK(args->GetString(0, &process_id_str));
- CHECK(args->GetString(1, &route_id_str));
- CHECK(base::StringToInt(process_id_str, &process_id));
- CHECK(base::StringToInt(route_id_str, &route_id));
- CHECK(args->GetString(2, &request_type));
- CHECK(request_type == "showTree" || request_type == "copyTree");
+ const base::DictionaryValue* data;
+ CHECK(args->GetDictionary(0, &data));
+
+ int process_id = *data->FindIntPath(kProcessIdField);
+ int route_id = *data->FindIntPath(kRouteIdField);
+
+ const std::string* request_type_p = data->FindStringPath(kRequestTypeField);
+ CHECK(IsValidJSValue(request_type_p));
+ std::string request_type = *request_type_p;
+ CHECK(request_type == kShowOrRefreshTree || request_type == kCopyTree);
request_type = "accessibility." + request_type;
+ const std::string* allow_p = data->FindStringPath("filters.allow");
+ CHECK(IsValidJSValue(allow_p));
+ std::string allow = *allow_p;
+ const std::string* allow_empty_p = data->FindStringPath("filters.allowEmpty");
+ CHECK(IsValidJSValue(allow_empty_p));
+ std::string allow_empty = *allow_empty_p;
+ const std::string* deny_p = data->FindStringPath("filters.deny");
+ CHECK(IsValidJSValue(deny_p));
+ std::string deny = *deny_p;
+
AllowJavascript();
content::RenderViewHost* rvh =
content::RenderViewHost::FromID(process_id, route_id);
@@ -443,7 +521,7 @@ void AccessibilityUIMessageHandler::RequestWebContentsTree(
std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue());
result->SetInteger(kProcessIdField, process_id);
result->SetInteger(kRouteIdField, route_id);
- result->SetString("error", "Renderer no longer exists.");
+ result->SetString(kErrorField, "Renderer no longer exists.");
CallJavascriptFunction(request_type, *(result.get()));
return;
}
@@ -456,29 +534,62 @@ void AccessibilityUIMessageHandler::RequestWebContentsTree(
web_contents->SetAccessibilityMode(
ui::AXMode(ui::AXMode::kNativeAPIs | ui::AXMode::kWebContents));
+ std::vector<content::AccessibilityTreeFormatter::PropertyFilter>
+ property_filters;
+ AddPropertyFilters(
+ property_filters, allow,
+ content::AccessibilityTreeFormatter::PropertyFilter::ALLOW);
+ AddPropertyFilters(
+ property_filters, allow_empty,
+ content::AccessibilityTreeFormatter::PropertyFilter::ALLOW_EMPTY);
+ AddPropertyFilters(property_filters, deny,
+ content::AccessibilityTreeFormatter::PropertyFilter::DENY);
+
PrefService* pref = Profile::FromWebUI(web_ui())->GetPrefs();
bool internal = pref->GetBoolean(prefs::kShowInternalAccessibilityTree);
base::string16 accessibility_contents_utf16 =
- web_contents->DumpAccessibilityTree(internal);
- result->SetString("tree", base::UTF16ToUTF8(accessibility_contents_utf16));
+ web_contents->DumpAccessibilityTree(internal, property_filters);
+ result->SetString(kTreeField,
+ base::UTF16ToUTF8(accessibility_contents_utf16));
CallJavascriptFunction(request_type, *(result.get()));
}
void AccessibilityUIMessageHandler::RequestNativeUITree(
const base::ListValue* args) {
- std::string session_id_str;
- int session_id;
- std::string request_type;
- CHECK_EQ(2U, args->GetSize());
- CHECK(args->GetString(0, &session_id_str));
- CHECK(base::StringToInt(session_id_str, &session_id));
- CHECK(args->GetString(1, &request_type));
- CHECK(request_type == "showTree" || request_type == "copyTree");
+ const base::DictionaryValue* data;
+ CHECK(args->GetDictionary(0, &data));
+
+ int session_id = *data->FindIntPath(kSessionIdField);
+ const std::string* request_type_p = data->FindStringPath(kRequestTypeField);
+ CHECK(IsValidJSValue(request_type_p));
+ std::string request_type = *request_type_p;
+ CHECK(request_type == kShowOrRefreshTree || request_type == kCopyTree);
request_type = "accessibility." + request_type;
+ const std::string* allow_p = data->FindStringPath("filters.allow");
+ CHECK(IsValidJSValue(allow_p));
+ std::string allow = *allow_p;
+ const std::string* allow_empty_p = data->FindStringPath("filters.allowEmpty");
+ CHECK(IsValidJSValue(allow_empty_p));
+ std::string allow_empty = *allow_empty_p;
+ const std::string* deny_p = data->FindStringPath("filters.deny");
+ CHECK(IsValidJSValue(deny_p));
+ std::string deny = *deny_p;
+
AllowJavascript();
#if !defined(OS_ANDROID)
+ std::vector<content::AccessibilityTreeFormatter::PropertyFilter>
+ property_filters;
+ AddPropertyFilters(
+ property_filters, allow,
+ content::AccessibilityTreeFormatter::PropertyFilter::ALLOW);
+ AddPropertyFilters(
+ property_filters, allow_empty,
+ content::AccessibilityTreeFormatter::PropertyFilter::ALLOW_EMPTY);
+ AddPropertyFilters(property_filters, deny,
+ content::AccessibilityTreeFormatter::PropertyFilter::DENY);
+
for (Browser* browser : *BrowserList::GetInstance()) {
if (browser->session_id().id() == session_id) {
std::unique_ptr<base::DictionaryValue> result(
@@ -486,8 +597,9 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
gfx::NativeWindow native_window = browser->window()->GetNativeWindow();
ui::AXPlatformNode* node =
ui::AXPlatformNode::FromNativeWindow(native_window);
- result->SetKey("tree",
- base::Value(RecursiveDumpAXPlatformNodeAsString(node, 0)));
+ result->SetKey(kTreeField,
+ base::Value(RecursiveDumpAXPlatformNodeAsString(
+ node, 0, property_filters)));
CallJavascriptFunction(request_type, *(result.get()));
return;
}
@@ -496,8 +608,8 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
// No browser with the specified |session_id| was found.
std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue());
result->SetInteger(kSessionIdField, session_id);
- result->SetString(kTypeField, "browser");
- result->SetString("error", "Browser no longer exists.");
+ result->SetString(kTypeField, kBrowser);
+ result->SetString(kErrorField, "Browser no longer exists.");
CallJavascriptFunction(request_type, *(result.get()));
}
diff --git a/chromium/chrome/browser/accessibility/image_annotation_browsertest.cc b/chromium/chrome/browser/accessibility/image_annotation_browsertest.cc
index c150bc9728a..d3860e222e3 100644
--- a/chromium/chrome/browser/accessibility/image_annotation_browsertest.cc
+++ b/chromium/chrome/browser/accessibility/image_annotation_browsertest.cc
@@ -21,17 +21,22 @@
#include "content/public/common/service_manager_connection.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test_utils.h"
+#include "mojo/public/cpp/bindings/pending_receiver.h"
+#include "mojo/public/cpp/bindings/pending_remote.h"
+#include "mojo/public/cpp/bindings/receiver_set.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/request_handler_util.h"
#include "services/image_annotation/public/cpp/image_processor.h"
#include "services/image_annotation/public/mojom/constants.mojom.h"
#include "services/image_annotation/public/mojom/image_annotation.mojom.h"
+#include "services/service_manager/public/cpp/binder_registry.h"
#include "services/service_manager/public/cpp/connector.h"
#include "services/service_manager/public/cpp/service.h"
#include "services/service_manager/public/cpp/service_binding.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/accessibility/ax_enum_util.h"
+#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/accessibility/ax_tree.h"
#include "url/gurl.h"
@@ -91,14 +96,17 @@ class FakeAnnotator : public image_annotation::mojom::Annotator {
FakeAnnotator() = default;
~FakeAnnotator() override = default;
- void BindRequest(image_annotation::mojom::AnnotatorRequest request) {
- bindings_.AddBinding(this, std::move(request));
+ void BindReceiver(
+ mojo::PendingReceiver<image_annotation::mojom::Annotator> receiver) {
+ receivers_.Add(this, std::move(receiver));
}
- void AnnotateImage(const std::string& image_id,
- const std::string& description_language_tag,
- image_annotation::mojom::ImageProcessorPtr image_processor,
- AnnotateImageCallback callback) override {
+ void AnnotateImage(
+ const std::string& image_id,
+ const std::string& description_language_tag,
+ mojo::PendingRemote<image_annotation::mojom::ImageProcessor>
+ image_processor,
+ AnnotateImageCallback callback) override {
if (return_error_code_) {
image_annotation::mojom::AnnotateImageResultPtr result =
image_annotation::mojom::AnnotateImageResult::NewErrorCode(
@@ -135,7 +143,7 @@ class FakeAnnotator : public image_annotation::mojom::Annotator {
}
private:
- mojo::BindingSet<image_annotation::mojom::Annotator> bindings_;
+ mojo::ReceiverSet<image_annotation::mojom::Annotator> receivers_;
static bool return_ocr_results_;
static bool return_label_results_;
static base::Optional<image_annotation::mojom::AnnotateImageError>
@@ -172,7 +180,7 @@ class FakeImageAnnotationService : public service_manager::Service {
void OnStart() override {
registry_.AddInterface<image_annotation::mojom::Annotator>(
- base::BindRepeating(&FakeAnnotator::BindRequest,
+ base::BindRepeating(&FakeAnnotator::BindReceiver,
base::Unretained(&annotator_)));
}
diff --git a/chromium/chrome/browser/accessibility/interstitial_accessibility_browsertest.cc b/chromium/chrome/browser/accessibility/interstitial_accessibility_browsertest.cc
index bd453ac2df2..ef7bf9f34b7 100644
--- a/chromium/chrome/browser/accessibility/interstitial_accessibility_browsertest.cc
+++ b/chromium/chrome/browser/accessibility/interstitial_accessibility_browsertest.cc
@@ -15,6 +15,7 @@
#include "content/public/test/test_navigation_observer.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/request_handler_util.h"
+#include "ui/accessibility/ax_enums.mojom.h"
class InterstitialAccessibilityBrowserTest : public InProcessBrowserTest {
public: