0
Files
src/content/shell
Ming-Ying Chung 8565da3d27 Revert "[A11yPerformance] Clean up BrowserAccessibilityState"
This reverts commit 8c794f38d3.

Reason for revert: breaks test on multiple Mac bots crbug.com/404576872

Original change's description:
> [A11yPerformance] Clean up BrowserAccessibilityState
>
> 1. Clarify which methods/variables are related to Auto Disable as
>    opposed to just Disable (manually disabling of a11y), so that
>    it's no longer confusing what belongs to what intention.
>
> 2. Rename some methods to accurately reflect what they do,
>   and add comments:
> * IsRendererAccessibilityEnabled() -> IsAccessibilityAllowed().
>   This was not specific to renderers, or whether a11y was enabled.
>   It returned true if a11y was not disallowed via the command line.
> * EnableAccessibility() -> EnableCompleteAccessibility().
>   This turns on kAXModeComplete.
>
> 3. Remove some poorly named and redundant methods that are not
>    actually needed:
> * ResetAccessibilityMode() -- the same as DisableAccessibility().
> * OnScreenReaderDetected() -- did not actually reflect screen
>   reader detection and was just a way to EnableAccessibility(), so
>   is redundant with that. Any remaining methods and modes with
>   "screen reader" in the name will now make sense.
> * OnScreenReaderStopped() -- did not actually reflect the stoppage
>   of a screen reader and callers are better off using
>   DisableAccessibility().
>
> 4. The new UMA Accessibility.EngineUse.TimeUntilStart that was just
>    added was not working on all platforms, because some platforms
>    use AddAccessibilityModeFlags() and others use
>    EnableAccessibility(). Move the UMA code to
>    OnAccessibilityAPIUsage() where it will always be hit.
>
> This relates to a11y performance because it helps build the
> foundation for the auto disable refresh by clarifying what
> different pieces do and cleaning up code paths.
>
> Follow-ups:
> - Audit calls to OnAccessibilityAPIUsed(), such as from
> AXPlatformNodeDelegate::GetRole(). If we don't change that, we'll
> always think that there's new API usage every time we Unserialize
> from a renderer, which breaks the auto-disable heuristic.
> - Use ScopedAccessibilityMode for chrome/browser/apps/app_shim/app_shim_host_mac.cc.
>
> Bug: 401232343
> Change-Id: Id386c378812484aae01e2a93dac90336c0aa7ae3
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6333854
> Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
> Reviewed-by: Greg Thompson <grt@chromium.org>
> Reviewed-by: Benjamin Beaudry <benjamin.beaudry@microsoft.com>
> Reviewed-by: Nasko Oskov <nasko@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1434483}

Bug: 401232343,404576872
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I6d43b0fa9d36b7ee0adeaf38b2b04e2b044eea60
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6367795
Reviewed-by: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Ming-Ying Chung <mych@chromium.org>
Owners-Override: Ming-Ying Chung <mych@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1434613}
2025-03-18 21:28:16 -07:00
..