chromium/ui/accessibility/accessibility_features.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/accessibility/accessibility_features.h"

#include "base/feature_list.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "ui/accessibility/ax_features.mojom-features.h"

#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/constants/ash_features.h"
#endif

namespace features {

BASE_FEATURE();
bool IsAccessibilityPdfOcrForSelectToSpeakEnabled() {}

BASE_FEATURE();
bool IsAccessibilityPruneRedundantInlineTextEnabled() {}

BASE_FEATURE();
bool IsAccessibilityPruneRedundantInlineConnectivityEnabled() {}

BASE_FEATURE();
bool IsImageDescriptionsAlternateRoutingEnabled() {}

BASE_FEATURE();
bool IsAutoDisableAccessibilityEnabled() {}

BASE_FEATURE();
bool IsAccessibilityAriaVirtualContentEnabled() {}

BASE_FEATURE();
bool IsAccessibilityLanguageDetectionEnabled() {}

BASE_FEATURE();
bool IsAccessibilityRestrictiveIA2AXModesEnabled() {}

BASE_FEATURE();
bool IsAccessibilityTreeForViewsEnabled() {}

BASE_FEATURE();
bool IsAriaElementReflectionEnabled() {}

BASE_FEATURE();
bool IsTextBasedAudioDescriptionEnabled() {}

BASE_FEATURE();
bool IsUseAXPositionForDocumentMarkersEnabled() {}

BASE_FEATURE();
bool IsUseMoveNotCopyInMergeTreeUpdateEnabled() {}

#if BUILDFLAG(IS_WIN)
BASE_FEATURE(kIChromeAccessible,
             "IChromeAccessible",
             base::FEATURE_DISABLED_BY_DEFAULT);
bool IsIChromeAccessibleEnabled() {
  return base::FeatureList::IsEnabled(::features::kIChromeAccessible);
}

BASE_FEATURE(kSelectiveUIAEnablement,
             "SelectiveUIAEnablement",
             base::FEATURE_ENABLED_BY_DEFAULT);
bool IsSelectiveUIAEnablementEnabled() {
  return base::FeatureList::IsEnabled(::features::kSelectiveUIAEnablement);
}

BASE_FEATURE(kUiaProvider, "UiaProvider", base::FEATURE_DISABLED_BY_DEFAULT);
#endif  // BUILDFLAG(IS_WIN)

#if BUILDFLAG(IS_CHROMEOS_ASH)
bool IsDictationOfflineAvailable() {
  return base::FeatureList::IsEnabled(
      ash::features::kOnDeviceSpeechRecognition);
}

BASE_FEATURE(kAccessibilityAccelerator,
             "AccessibilityAccelerator",
             base::FEATURE_ENABLED_BY_DEFAULT);
bool IsAccessibilityAcceleratorEnabled() {
  return base::FeatureList::IsEnabled(::features::kAccessibilityAccelerator);
}

BASE_FEATURE(kAccessibilityReducedAnimations,
             "AccessibilityReducedAnimations",
             base::FEATURE_ENABLED_BY_DEFAULT);
bool IsAccessibilityReducedAnimationsEnabled() {
  return base::FeatureList::IsEnabled(
      ::features::kAccessibilityReducedAnimations);
}

BASE_FEATURE(kAccessibilityFaceGaze,
             "AccessibilityFaceGaze",
             base::FEATURE_DISABLED_BY_DEFAULT);
bool IsAccessibilityFaceGazeEnabled() {
  return base::FeatureList::IsEnabled(::features::kAccessibilityFaceGaze);
}

BASE_FEATURE(kAccessibilityFaceGazeGravityWells,
             "AccessibilityFaceGazeGravityWells",
             base::FEATURE_DISABLED_BY_DEFAULT);
bool IsAccessibilityFaceGazeGravityWellsEnabled() {
  return base::FeatureList::IsEnabled(
      ::features::kAccessibilityFaceGazeGravityWells);
}

BASE_FEATURE(kAccessibilityReducedAnimationsInKiosk,
             "AccessibilityReducedAnimationsInKiosk",
             base::FEATURE_ENABLED_BY_DEFAULT);
bool IsAccessibilityReducedAnimationsInKioskEnabled() {
  return base::FeatureList::IsEnabled(
      ::features::kAccessibilityReducedAnimationsInKiosk);
}

BASE_FEATURE(kExperimentalAccessibilityGoogleTtsHighQualityVoices,
             "ExperimentalAccessibilityGoogleTtsHighQualityVoices",
             base::FEATURE_ENABLED_BY_DEFAULT);
bool IsExperimentalAccessibilityGoogleTtsHighQualityVoicesEnabled() {
  return base::FeatureList::IsEnabled(
      ::features::kExperimentalAccessibilityGoogleTtsHighQualityVoices);
}

BASE_FEATURE(kExperimentalAccessibilityDictationContextChecking,
             "ExperimentalAccessibilityDictationContextChecking",
             base::FEATURE_DISABLED_BY_DEFAULT);
bool IsExperimentalAccessibilityDictationContextCheckingEnabled() {
  return base::FeatureList::IsEnabled(
      ::features::kExperimentalAccessibilityDictationContextChecking);
}

BASE_FEATURE(kAccessibilityMagnifierFollowsChromeVox,
             "AccessibilityMagnifierFollowsChromeVox",
             base::FEATURE_ENABLED_BY_DEFAULT);
bool IsAccessibilityMagnifierFollowsChromeVoxEnabled() {
  return base::FeatureList::IsEnabled(
      ::features::kAccessibilityMagnifierFollowsChromeVox);
}

BASE_FEATURE(kAccessibilityMagnifierFollowsSts,
             "AccessibilityMagnifierFollowsSts",
             base::FEATURE_ENABLED_BY_DEFAULT);
bool IsAccessibilityMagnifierFollowsStsEnabled() {
  return base::FeatureList::IsEnabled(
      ::features::kAccessibilityMagnifierFollowsSts);
}

BASE_FEATURE(kAccessibilityMouseKeys,
             "AccessibilityMouseKeys",
             base::FEATURE_DISABLED_BY_DEFAULT);
bool IsAccessibilityMouseKeysEnabled() {
  return base::FeatureList::IsEnabled(::features::kAccessibilityMouseKeys);
}

BASE_FEATURE(kAccessibilityCaretBlinkIntervalSetting,
             "AccessibilityCaretBlinkIntervalSetting",
             base::FEATURE_ENABLED_BY_DEFAULT);
bool IsAccessibilityCaretBlinkIntervalSettingEnabled() {
  return base::FeatureList::IsEnabled(
      ::features::kAccessibilityCaretBlinkIntervalSetting);
}

BASE_FEATURE(kAccessibilityOverscrollSettingFeature,
             "AccessibilityOverscrollSettingFeature",
             base::FEATURE_ENABLED_BY_DEFAULT);
bool IsAccessibilityOverscrollSettingFeatureEnabled() {
  return base::FeatureList::IsEnabled(
      ::features::kAccessibilityOverscrollSettingFeature);
}

BASE_FEATURE(kAccessibilitySelectToSpeakShortcut,
             "AccessibilitySelectToSpeakShortcut",
             base::FEATURE_ENABLED_BY_DEFAULT);
bool IsAccessibilitySelectToSpeakShortcutEnabled() {
  return base::FeatureList::IsEnabled(
      ::features::kAccessibilitySelectToSpeakShortcut);
}

BASE_FEATURE(kAccessibilityDisableTrackpad,
             "AccessibilityDisableTrackpad",
             base::FEATURE_DISABLED_BY_DEFAULT);
bool IsAccessibilityDisableTrackpadEnabled() {
  return base::FeatureList::IsEnabled(
      ::features::kAccessibilityDisableTrackpad);
}

BASE_FEATURE(kAccessibilityFlashScreenFeature,
             "AccessibilityFlashScreenFeature",
             base::FEATURE_DISABLED_BY_DEFAULT);
bool IsAccessibilityFlashScreenFeatureEnabled() {
  return base::FeatureList::IsEnabled(
      ::features::kAccessibilityFlashScreenFeature);
}

BASE_FEATURE(kAccessibilityFilterKeys,
             "AccessibilityFilterKeys",
             base::FEATURE_DISABLED_BY_DEFAULT);
bool IsAccessibilityFilterKeysEnabled() {
  return base::FeatureList::IsEnabled(::features::kAccessibilityFilterKeys);
}

BASE_FEATURE(kAccessibilityShakeToLocate,
             "AccessibilityShakeToLocate",
             base::FEATURE_DISABLED_BY_DEFAULT);
bool IsAccessibilityShakeToLocateEnabled() {
  return base::FeatureList::IsEnabled(::features::kAccessibilityShakeToLocate);
}

BASE_FEATURE(kAccessibilityMagnifyAcceleratorDialog,
             "AccessibilityMagnifyAcceleratorDialog",
             base::FEATURE_ENABLED_BY_DEFAULT);
bool IsAccessibilityMagnifyAcceleratorDialogEnabled() {
  return base::FeatureList::IsEnabled(
      ::features::kAccessibilityMagnifyAcceleratorDialog);
}

#endif  // BUILDFLAG(IS_CHROMEOS_ASH)

#if BUILDFLAG(IS_ANDROID)
BASE_FEATURE(kAccessibilitySnapshotStressTests,
             "AccessibilitySnapshotStressTests",
             base::FEATURE_DISABLED_BY_DEFAULT);
bool IsAccessibilitySnapshotStressTestsEnabled() {
  return base::FeatureList::IsEnabled(
      ::features::kAccessibilitySnapshotStressTests);
}
#endif  // BUILDFLAG(IS_ANDROID)

#if !BUILDFLAG(IS_ANDROID)
bool IsScreenAIMainContentExtractionEnabled() {}

bool IsScreenAIOCREnabled() {}

BASE_FEATURE();
bool IsAccessibilityServiceEnabled() {}

// This feature is only used for generating training data for Screen2x and
// should never be used in any other circumstance, and should not be enabled by
// default.
BASE_FEATURE();
bool IsDataCollectionModeForScreen2xEnabled() {}

BASE_FEATURE();
bool IsMainNodeAnnotationsEnabled() {}

// This feature has a 10% holdback to measure memory impact.
BASE_FEATURE();

bool IsPdfOcrEnabled() {}

BASE_FEATURE();
bool IsReadAnythingReadAloudEnabled() {}

BASE_FEATURE();
bool IsReadAloudAutoVoiceSwitchingEnabled() {}

BASE_FEATURE();
bool IsReadAloudLanguagePackDownloadingEnabled() {}

BASE_FEATURE();
bool IsReadAnythingReadAloudAutomaticWordHighlightingEnabled() {}

BASE_FEATURE();
bool IsReadAnythingReadAloudPhraseHighlightingEnabled() {}

BASE_FEATURE();
bool IsReadAnythingWithScreen2xEnabled() {}

BASE_FEATURE();
bool IsReadAnythingWithAlgorithmEnabled() {}

BASE_FEATURE();
bool IsReadAnythingImagesViaAlgorithmEnabled() {}

BASE_FEATURE();
bool IsReadAnythingDocsIntegrationEnabled() {}

BASE_FEATURE();
bool IsReadAnythingDocsLoadMoreButtonEnabled() {}

// This feature is only for debug purposes and for security/privacy reasons,
// should be never enabled by default .
BASE_FEATURE();
bool IsScreenAIDebugModeEnabled() {}

// This feature is only used in tests and must not be enabled by default.
BASE_FEATURE();
bool IsScreenAITestModeEnabled() {}

#endif  // !BUILDFLAG(IS_ANDROID)

#if BUILDFLAG(IS_MAC)
BASE_FEATURE(kAccessibilityRemoteUIApp,
             "AccessibilityRemoteUIApp",
             base::FEATURE_ENABLED_BY_DEFAULT);
bool IsAccessibilityRemoteUIAppEnabled() {
  return base::FeatureList::IsEnabled(::features::kAccessibilityRemoteUIApp);
}
#endif  // BUILDFLAG(IS_MAC)

}  // namespace features