From 27ae133811c7686b1f04cf4c02f286a6b2c679cd Mon Sep 17 00:00:00 2001 From: Jacques Newman Date: Sun, 4 Jun 2023 01:08:03 +0000 Subject: [PATCH] Keep sending honey pot messages until we turn on web contents. This is a high priority change, the bug this fixes is stopping all JAWS 2021 users from being able to access web contents. With some Windows 11 features causing kNativeAPIs to be turned on after startup, our honeypot code was no longer being triggered. Since there are many other ways to turn on accessibility this was not noticed until recently. This change updates our logic to no longer consider the fact that some accessibility has been enabled as an indication that we no longer should fire the honey pot event. With this change we will continue to send honey pot events until web contents accessibility has been turned on. The honey pot will trigger web contents accessibility, and at that point will no longer fire. (cherry picked from commit be11a302db1cc8c5fc1cb07c9b939350aa73a9e1) Bug: 1450993 Change-Id: I65cfa0e2c5daf2eaef19241e70e1f23670714216 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4585299 Reviewed-by: Benjamin Beaudry Reviewed-by: Aaron Leventhal Reviewed-by: Alexander Timin Reviewed-by: Nektarios Paisios Commit-Queue: Aaron Leventhal Cr-Original-Commit-Position: refs/heads/main@{#1152873} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4586501 Commit-Queue: Srinivas Sista Bot-Commit: Rubber Stamper Owners-Override: Srinivas Sista Cr-Commit-Position: refs/branch-heads/5735_90@{#8} Cr-Branched-From: 386bc09e8f4f2e025eddae123f36f6263096ae49-refs/branch-heads/5735@{#1052} Cr-Branched-From: 2f562e4ddbaf79a3f3cb338b4d1bd4398d49eb67-refs/heads/main@{#1135570} --- .../browser/renderer_host/legacy_render_widget_host_win.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/browser/renderer_host/legacy_render_widget_host_win.cc b/content/browser/renderer_host/legacy_render_widget_host_win.cc index 89bcbe4a8d5e0f..c7bc52f1b54249 100644 --- a/content/browser/renderer_host/legacy_render_widget_host_win.cc +++ b/content/browser/renderer_host/legacy_render_widget_host_win.cc @@ -201,9 +201,11 @@ bool LegacyRenderWidgetHostHWND::InitOrDeleteSelf(HWND parent) { ax_fragment_root_ = std::make_unique(hwnd(), this); } + // Continue to send honey pot events until we have kWebContents to + // ensure screen readers have the opportunity to enable. ui::AXMode mode = BrowserAccessibilityStateImpl::GetInstance()->GetAccessibilityMode(); - if (!mode.has_mode(ui::AXMode::kNativeAPIs)) { + if (!mode.has_mode(ui::AXMode::kWebContents)) { // Attempt to detect screen readers or other clients who want full // accessibility support, by seeing if they respond to this event. NotifyWinEvent(EVENT_SYSTEM_ALERT, hwnd(), kIdScreenReaderHoneyPot,