feat: honor nativeTheme.themeSource = 'dark' before creating BrowserWindow on Windows (#25373)

* fix: support 'dark' theme before creating windows.
This commit is contained in:
Charles Kerr 2020-10-28 15:00:21 -05:00 committed by GitHub
parent d3f32c7502
commit f489e3054a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 241 additions and 0 deletions

View file

@ -58,6 +58,10 @@ bool IsPictureInPictureEnabled() {
return BUILDFLAG(ENABLE_PICTURE_IN_PICTURE);
}
bool IsWinDarkModeWindowUiEnabled() {
return BUILDFLAG(ENABLE_WIN_DARK_MODE_WINDOW_UI);
}
bool IsComponentBuild() {
#if defined(COMPONENT_BUILD)
return true;
@ -85,6 +89,7 @@ void Initialize(v8::Local<v8::Object> exports,
dict.SetMethod("isPictureInPictureEnabled", &IsPictureInPictureEnabled);
dict.SetMethod("isComponentBuild", &IsComponentBuild);
dict.SetMethod("isExtensionsEnabled", &IsExtensionsEnabled);
dict.SetMethod("isWinDarkModeWindowUiEnabled", &IsWinDarkModeWindowUiEnabled);
}
} // namespace