diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-09-29 16:16:15 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-11-09 10:04:06 +0000 |
commit | a95a7417ad456115a1ef2da4bb8320531c0821f1 (patch) | |
tree | edcd59279e486d2fd4a8f88a7ed025bcf925c6e6 /chromium/chrome/browser/accessibility/accessibility_state_utils.cc | |
parent | 33fc33aa94d4add0878ec30dc818e34e1dd3cc2a (diff) | |
download | qtwebengine-chromium-a95a7417ad456115a1ef2da4bb8320531c0821f1.tar.gz |
BASELINE: Update Chromium to 106.0.5249.126
Change-Id: Ib0bb21c437a7d1686e21c33f2d329f2ac425b7ab
Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/438936
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/chrome/browser/accessibility/accessibility_state_utils.cc')
-rw-r--r-- | chromium/chrome/browser/accessibility/accessibility_state_utils.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/chromium/chrome/browser/accessibility/accessibility_state_utils.cc b/chromium/chrome/browser/accessibility/accessibility_state_utils.cc index 51f38e3fe95..c8a59f46a6a 100644 --- a/chromium/chrome/browser/accessibility/accessibility_state_utils.cc +++ b/chromium/chrome/browser/accessibility/accessibility_state_utils.cc @@ -15,11 +15,22 @@ namespace accessibility_state_utils { +enum class OverrideStatus { kNotSet = 0, kEnabled = 1, kDisabled = 2 }; + +static OverrideStatus screen_reader_enabled_override_for_testing = + OverrideStatus::kNotSet; + #if BUILDFLAG(IS_CHROMEOS_ASH) using ::ash::AccessibilityManager; #endif bool IsScreenReaderEnabled() { + if (screen_reader_enabled_override_for_testing != OverrideStatus::kNotSet) { + return (screen_reader_enabled_override_for_testing == + OverrideStatus::kEnabled) + ? true + : false; + } #if BUILDFLAG(IS_CHROMEOS_ASH) return AccessibilityManager::Get() && AccessibilityManager::Get()->IsSpokenFeedbackEnabled(); @@ -32,4 +43,9 @@ bool IsScreenReaderEnabled() { #endif // BUILDFLAG(IS_CHROMEOS_ASH) } +void OverrideIsScreenReaderEnabledForTesting(bool enabled) { + screen_reader_enabled_override_for_testing = + enabled ? OverrideStatus::kEnabled : OverrideStatus::kDisabled; +} + } // namespace accessibility_state_utils |