#include "ui/base/ui_base_features.h"
#include <stdlib.h>
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/metrics/field_trial_params.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#if BUILDFLAG(IS_ANDROID)
#include "base/android/build_info.h"
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ui/base/shortcut_mapping_pref_delegate.h"
#endif
namespace features {
#if BUILDFLAG(IS_WIN)
BASE_FEATURE(kApplyNativeOccludedRegionToWindowTracker,
"ApplyNativeOccludedRegionToWindowTracker",
base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kCalculateNativeWinOcclusion,
"CalculateNativeWinOcclusion",
base::FEATURE_ENABLED_BY_DEFAULT);
BASE_FEATURE(kScreenPowerListenerForNativeWinOcclusion,
"ScreenPowerListenerForNativeWinOcclusion",
base::FEATURE_ENABLED_BY_DEFAULT);
#endif
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS_LACROS)
BASE_FEATURE(kApplyNativeOcclusionToCompositor,
"ApplyNativeOcclusionToCompositor",
#if BUILDFLAG(IS_CHROMEOS_LACROS)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
#endif
);
BASE_FEATURE(kAlwaysTrackNativeWindowOcclusionForTest,
"AlwaysTrackNativeWindowOcclusionForTest",
base::FEATURE_DISABLED_BY_DEFAULT);
const base::FeatureParam<std::string> kApplyNativeOcclusionToCompositorType{
&kApplyNativeOcclusionToCompositor, "type",
#if BUILDFLAG(IS_CHROMEOS_LACROS)
"throttle_and_release"
#else
""
#endif
};
const char kApplyNativeOcclusionToCompositorTypeRelease[] = "release";
const char kApplyNativeOcclusionToCompositorTypeThrottle[] = "throttle";
const char kApplyNativeOcclusionToCompositorTypeThrottleAndRelease[] =
"throttle_and_release";
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
BASE_FEATURE(kSettingsShowsPerKeyboardSettings,
"InputMethodIntegratedSettings",
base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kDeprecateAltClick,
"DeprecateAltClick",
base::FEATURE_DISABLED_BY_DEFAULT);
bool IsDeprecateAltClickEnabled() {
return base::FeatureList::IsEnabled(kDeprecateAltClick);
}
BASE_FEATURE(kNotificationsIgnoreRequireInteraction,
"NotificationsIgnoreRequireInteraction",
base::FEATURE_ENABLED_BY_DEFAULT);
bool IsNotificationsIgnoreRequireInteractionEnabled() {
return base::FeatureList::IsEnabled(kNotificationsIgnoreRequireInteraction);
}
BASE_FEATURE(kShortcutCustomization,
"ShortcutCustomization",
base::FEATURE_ENABLED_BY_DEFAULT);
bool IsShortcutCustomizationEnabled() {
return base::FeatureList::IsEnabled(kShortcutCustomization);
}
BASE_FEATURE(kLacrosResourcesFileSharing,
"LacrosResourcesFileSharing",
base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kSupportF11AndF12KeyShortcuts,
"SupportF11AndF12KeyShortcuts",
base::FEATURE_ENABLED_BY_DEFAULT);
bool AreF11AndF12ShortcutsEnabled() {
if (::ui::ShortcutMappingPrefDelegate::IsInitialized()) {
::ui::ShortcutMappingPrefDelegate* instance =
::ui::ShortcutMappingPrefDelegate::GetInstance();
if (instance && instance->IsDeviceEnterpriseManaged()) {
return instance->IsI18nShortcutPrefEnabled() &&
base::FeatureList::IsEnabled(
features::kSupportF11AndF12KeyShortcuts);
}
}
return base::FeatureList::IsEnabled(features::kSupportF11AndF12KeyShortcuts);
}
#endif
#if BUILDFLAG(IS_OZONE)
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
#endif
#if BUILDFLAG(IS_LINUX)
COMPONENT_EXPORT(UI_BASE_FEATURES)
BASE_FEATURE(kOverrideDefaultOzonePlatformHintToAuto,
"OverrideDefaultOzonePlatformHintToAuto",
base::FEATURE_DISABLED_BY_DEFAULT);
#endif
BASE_FEATURE(…);
const enum base::FeatureState kWindowsScrollingPersonalityDefaultStatus = …;
static_assert …;
BASE_FEATURE(…);
bool IsPercentBasedScrollingEnabled() { … }
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
bool IsSystemCursorSizeSupported() { … }
BASE_FEATURE(…);
BASE_FEATURE(…);
bool IsUiGpuRasterizationEnabled() { … }
BASE_FEATURE(…);
BASE_FEATURE(…);
#if BUILDFLAG(IS_ANDROID)
BASE_FEATURE(kClipboardFiles,
"ClipboardFiles",
base::FEATURE_ENABLED_BY_DEFAULT);
BASE_FEATURE(kDragDropFiles, "DragDropFiles", base::FEATURE_ENABLED_BY_DEFAULT);
#endif
#if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_WIN)
BASE_FEATURE(kElasticOverscroll,
"ElasticOverscroll",
#if BUILDFLAG(IS_ANDROID)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
#endif
);
#endif
BASE_FEATURE(…);
#if BUILDFLAG(IS_WIN)
BASE_FEATURE(kPointerEventsForTouch,
"PointerEventsForTouch",
base::FEATURE_ENABLED_BY_DEFAULT);
bool IsUsingWMPointerForTouch() {
return base::FeatureList::IsEnabled(kPointerEventsForTouch);
}
#endif
#if BUILDFLAG(IS_CHROMEOS)
BASE_FEATURE(kImprovedKeyboardShortcuts,
"ImprovedKeyboardShortcuts",
base::FEATURE_ENABLED_BY_DEFAULT);
bool IsImprovedKeyboardShortcutsEnabled() {
#if BUILDFLAG(IS_CHROMEOS_ASH)
if (::ui::ShortcutMappingPrefDelegate::IsInitialized()) {
::ui::ShortcutMappingPrefDelegate* instance =
::ui::ShortcutMappingPrefDelegate::GetInstance();
if (instance && instance->IsDeviceEnterpriseManaged()) {
return instance->IsI18nShortcutPrefEnabled();
}
}
#endif
return base::FeatureList::IsEnabled(kImprovedKeyboardShortcuts);
}
#endif
BASE_FEATURE(…);
bool IsTouchTextEditingRedesignEnabled() { … }
BASE_FEATURE(…);
bool IsForcedColorsEnabled() { … }
BASE_FEATURE(…);
bool IsEyeDropperEnabled() { … }
BASE_FEATURE(…);
bool IsKeyboardAccessibleTooltipEnabled() { … }
BASE_FEATURE(…);
bool IsSynchronousPageFlipTestingEnabled() { … }
BASE_FEATURE(…);
const char kPredictorNameLsq[] = …;
const char kPredictorNameKalman[] = …;
const char kPredictorNameLinearFirst[] = …;
const char kPredictorNameLinearSecond[] = …;
const char kPredictorNameLinearResampling[] = …;
const char kPredictorNameEmpty[] = …;
const char kFilterNameEmpty[] = …;
const char kFilterNameOneEuro[] = …;
const char kPredictionTypeTimeBased[] = …;
const char kPredictionTypeFramesBased[] = …;
const char kPredictionTypeDefaultTime[] = …;
const char kPredictionTypeDefaultFramesRatio[] = …;
BASE_FEATURE(…);
BASE_FEATURE(…);
bool IsSwipeToMoveCursorEnabled() { … }
BASE_FEATURE(…);
const base::FeatureParam<double> kRawDrawTileSizeFactor{ … };
const base::FeatureParam<bool> kIsRawDrawUsingMSAA{ … };
bool IsUsingRawDraw() { … }
double RawDrawTileSizeFactor() { … }
bool IsRawDrawUsingMSAA() { … }
BASE_FEATURE(…);
BASE_FEATURE(…);
bool IsVariableRefreshRateEnabled() { … }
BASE_FEATURE(…);
bool IsVariableRefreshRateAlwaysOn() { … }
BASE_FEATURE(…);
bool IsLacrosColorManagementEnabled() { … }
BASE_FEATURE(…);
#if BUILDFLAG(IS_APPLE)
BASE_FEATURE(kCr2023MacFontSmoothing,
"Cr2023MacFontSmoothing",
base::FEATURE_ENABLED_BY_DEFAULT);
#endif
#if BUILDFLAG(IS_WIN)
BASE_FEATURE(kUseGammaContrastRegistrySettings,
"UseGammaContrastRegistrySettings",
base::FEATURE_ENABLED_BY_DEFAULT);
BASE_FEATURE(kIncreaseWindowsTextContrast,
"IncreaseWindowsTextContrast",
base::FEATURE_DISABLED_BY_DEFAULT);
#endif
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
BASE_FEATURE(…);
}