chore: remove deprecated systemPreferences methods (#26849)
This commit is contained in:
parent
6ccebdf712
commit
6932e17088
6 changed files with 29 additions and 50 deletions
|
@ -31,12 +31,6 @@ SystemPreferences::~SystemPreferences() {
|
|||
#endif
|
||||
}
|
||||
|
||||
#if !defined(OS_MAC)
|
||||
bool SystemPreferences::IsDarkMode() {
|
||||
return ui::NativeTheme::GetInstanceForNativeUi()->ShouldUseDarkColors();
|
||||
}
|
||||
#endif
|
||||
|
||||
bool SystemPreferences::IsInvertedColorScheme() {
|
||||
return ui::NativeTheme::GetInstanceForNativeUi()
|
||||
->GetPlatformHighContrastColorScheme() ==
|
||||
|
@ -115,11 +109,6 @@ gin::ObjectTemplateBuilder SystemPreferences::GetObjectTemplateBuilder(
|
|||
&SystemPreferences::IsTrustedAccessibilityClient)
|
||||
.SetMethod("askForMediaAccess", &SystemPreferences::AskForMediaAccess)
|
||||
#endif
|
||||
.SetMethod("isInvertedColorScheme",
|
||||
&SystemPreferences::IsInvertedColorScheme)
|
||||
.SetMethod("isHighContrastColorScheme",
|
||||
&SystemPreferences::IsHighContrastColorScheme)
|
||||
.SetMethod("isDarkMode", &SystemPreferences::IsDarkMode)
|
||||
.SetMethod("getAnimationSettings",
|
||||
&SystemPreferences::GetAnimationSettings);
|
||||
}
|
||||
|
|
|
@ -117,7 +117,6 @@ class SystemPreferences
|
|||
v8::Local<v8::Value> GetAppLevelAppearance(v8::Isolate* isolate);
|
||||
void SetAppLevelAppearance(gin::Arguments* args);
|
||||
#endif
|
||||
bool IsDarkMode();
|
||||
bool IsInvertedColorScheme();
|
||||
bool IsHighContrastColorScheme();
|
||||
v8::Local<v8::Value> GetAnimationSettings(v8::Isolate* isolate);
|
||||
|
|
|
@ -628,15 +628,6 @@ void SystemPreferences::RemoveUserDefault(const std::string& name) {
|
|||
[defaults removeObjectForKey:base::SysUTF8ToNSString(name)];
|
||||
}
|
||||
|
||||
bool SystemPreferences::IsDarkMode() {
|
||||
if (@available(macOS 10.14, *)) {
|
||||
return ui::NativeTheme::GetInstanceForNativeUi()->ShouldUseDarkColors();
|
||||
}
|
||||
NSString* mode = [[NSUserDefaults standardUserDefaults]
|
||||
stringForKey:@"AppleInterfaceStyle"];
|
||||
return [mode isEqualToString:@"Dark"];
|
||||
}
|
||||
|
||||
bool SystemPreferences::IsSwipeTrackingFromScrollEventsEnabled() {
|
||||
return [NSEvent isSwipeTrackingFromScrollEventsEnabled];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue