feat: add nativeTheme.inForcedColorsMode (#32956)

This commit is contained in:
Milan Burda 2022-03-21 10:30:02 +01:00 committed by GitHub
parent 4cc2ed842e
commit 755feb4d81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 1 deletions

View file

@ -67,6 +67,10 @@ bool NativeTheme::ShouldUseHighContrastColors() {
return ui_theme_->UserHasContrastPreference();
}
bool NativeTheme::InForcedColorsMode() {
return ui_theme_->InForcedColorsMode();
}
#if BUILDFLAG(IS_MAC)
const CFStringRef WhiteOnBlack = CFSTR("whiteOnBlack");
const CFStringRef UniversalAccessDomain = CFSTR("com.apple.universalaccess");
@ -106,7 +110,8 @@ gin::ObjectTemplateBuilder NativeTheme::GetObjectTemplateBuilder(
.SetProperty("shouldUseHighContrastColors",
&NativeTheme::ShouldUseHighContrastColors)
.SetProperty("shouldUseInvertedColorScheme",
&NativeTheme::ShouldUseInvertedColorScheme);
&NativeTheme::ShouldUseInvertedColorScheme)
.SetProperty("inForcedColorsMode", &NativeTheme::InForcedColorsMode);
}
const char* NativeTheme::GetTypeName() {