Fixes #24741
This commit is contained in:
parent
2d502b8ac6
commit
d9a1c453ab
8 changed files with 31 additions and 33 deletions
|
@ -914,6 +914,10 @@ void BaseWindow::CloseFilePreview() {
|
|||
window_->CloseFilePreview();
|
||||
}
|
||||
|
||||
void BaseWindow::SetGTKDarkThemeEnabled(bool use_dark_theme) {
|
||||
window_->SetGTKDarkThemeEnabled(use_dark_theme);
|
||||
}
|
||||
|
||||
v8::Local<v8::Value> BaseWindow::GetContentView() const {
|
||||
if (content_view_.IsEmpty())
|
||||
return v8::Null(isolate());
|
||||
|
|
|
@ -206,6 +206,7 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
|
|||
void SetAspectRatio(double aspect_ratio, gin_helper::Arguments* args);
|
||||
void PreviewFile(const std::string& path, gin_helper::Arguments* args);
|
||||
void CloseFilePreview();
|
||||
void SetGTKDarkThemeEnabled(bool use_dark_theme);
|
||||
|
||||
// Public getters of NativeWindow.
|
||||
v8::Local<v8::Value> GetContentView() const;
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
#include "content/public/browser/browser_task_traits.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "gin/handle.h"
|
||||
#include "shell/browser/native_window_views.h"
|
||||
#include "shell/browser/window_list.h"
|
||||
#include "shell/common/gin_converters/std_converter.h"
|
||||
#include "shell/common/gin_helper/dictionary.h"
|
||||
#include "shell/common/gin_helper/object_template_builder.h"
|
||||
|
@ -53,13 +51,8 @@ void NativeTheme::SetThemeSource(ui::NativeTheme::ThemeSource override) {
|
|||
// Update the macOS appearance setting for this new override value
|
||||
UpdateMacOSAppearanceForOverrideValue(override);
|
||||
#endif
|
||||
#if defined(USE_X11)
|
||||
const bool dark_enabled = ShouldUseDarkColors();
|
||||
for (auto* window : WindowList::GetWindows()) {
|
||||
static_cast<NativeWindowViews*>(window)->SetGTKDarkThemeEnabled(
|
||||
dark_enabled);
|
||||
}
|
||||
#endif
|
||||
// TODO(MarshallOfSound): Update all existing browsers windows to use GTK dark
|
||||
// theme
|
||||
}
|
||||
|
||||
ui::NativeTheme::ThemeSource NativeTheme::GetThemeSource() const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue