chore: remove deprecated systemPreferences color scheme events (#39341)
This commit is contained in:
parent
cf658b700d
commit
d166182865
6 changed files with 21 additions and 49 deletions
|
@ -33,16 +33,6 @@ SystemPreferences::~SystemPreferences() {
|
|||
SystemPreferences::~SystemPreferences() = default;
|
||||
#endif
|
||||
|
||||
bool SystemPreferences::IsInvertedColorScheme() {
|
||||
return ui::NativeTheme::GetInstanceForNativeUi()
|
||||
->GetPlatformHighContrastColorScheme() ==
|
||||
ui::NativeTheme::PlatformHighContrastColorScheme::kDark;
|
||||
}
|
||||
|
||||
bool SystemPreferences::IsHighContrastColorScheme() {
|
||||
return ui::NativeTheme::GetInstanceForNativeUi()->UserHasContrastPreference();
|
||||
}
|
||||
|
||||
v8::Local<v8::Value> SystemPreferences::GetAnimationSettings(
|
||||
v8::Isolate* isolate) {
|
||||
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
|
||||
|
|
|
@ -115,8 +115,6 @@ class SystemPreferences
|
|||
v8::Local<v8::Value> GetAppLevelAppearance(v8::Isolate* isolate);
|
||||
void SetAppLevelAppearance(gin::Arguments* args);
|
||||
#endif
|
||||
bool IsInvertedColorScheme();
|
||||
bool IsHighContrastColorScheme();
|
||||
v8::Local<v8::Value> GetAnimationSettings(v8::Isolate* isolate);
|
||||
|
||||
// disable copy
|
||||
|
@ -158,10 +156,6 @@ class SystemPreferences
|
|||
|
||||
std::string current_color_;
|
||||
|
||||
bool inverted_color_scheme_ = false;
|
||||
|
||||
bool high_contrast_color_scheme_ = false;
|
||||
|
||||
std::unique_ptr<gfx::ScopedSysColorChangeListener> color_change_listener_;
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -158,9 +158,6 @@ std::string SystemPreferences::GetMediaAccessStatus(
|
|||
}
|
||||
|
||||
void SystemPreferences::InitializeWindow() {
|
||||
inverted_color_scheme_ = IsInvertedColorScheme();
|
||||
high_contrast_color_scheme_ = IsHighContrastColorScheme();
|
||||
|
||||
// Wait until app is ready before creating sys color listener
|
||||
// Creating this listener before the app is ready causes global shortcuts
|
||||
// to not fire
|
||||
|
@ -216,18 +213,6 @@ LRESULT CALLBACK SystemPreferences::WndProc(HWND hwnd,
|
|||
}
|
||||
|
||||
void SystemPreferences::OnSysColorChange() {
|
||||
bool new_inverted_color_scheme = IsInvertedColorScheme();
|
||||
if (new_inverted_color_scheme != inverted_color_scheme_) {
|
||||
inverted_color_scheme_ = new_inverted_color_scheme;
|
||||
Emit("inverted-color-scheme-changed", new_inverted_color_scheme);
|
||||
}
|
||||
|
||||
bool new_high_contrast_color_scheme = IsHighContrastColorScheme();
|
||||
if (new_high_contrast_color_scheme != high_contrast_color_scheme_) {
|
||||
high_contrast_color_scheme_ = new_high_contrast_color_scheme;
|
||||
Emit("high-contrast-color-scheme-changed", new_high_contrast_color_scheme);
|
||||
}
|
||||
|
||||
Emit("color-changed");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue