fix: propagate preferred color scheme to the renderer (#22896)
* fix: do not crash if the window is closed syncronously with a nativeTheme change * fix: propogate preferred color scheme to the renderer and keep it up to date
This commit is contained in:
parent
212b47a77b
commit
fea3366bc7
7 changed files with 56 additions and 17 deletions
|
@ -22,7 +22,9 @@ class NativeTheme : public gin_helper::EventEmitter<NativeTheme>,
|
|||
v8::Local<v8::FunctionTemplate> prototype);
|
||||
|
||||
protected:
|
||||
NativeTheme(v8::Isolate* isolate, ui::NativeTheme* theme);
|
||||
NativeTheme(v8::Isolate* isolate,
|
||||
ui::NativeTheme* ui_theme,
|
||||
ui::NativeTheme* web_theme);
|
||||
~NativeTheme() override;
|
||||
|
||||
void SetThemeSource(ui::NativeTheme::ThemeSource override);
|
||||
|
@ -40,7 +42,8 @@ class NativeTheme : public gin_helper::EventEmitter<NativeTheme>,
|
|||
void OnNativeThemeUpdatedOnUI();
|
||||
|
||||
private:
|
||||
ui::NativeTheme* theme_;
|
||||
ui::NativeTheme* ui_theme_;
|
||||
ui::NativeTheme* web_theme_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(NativeTheme);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue