fix: revert 6ecf729 to fix Linux titlebar dark mode (#25055)

Fixes #24741
This commit is contained in:
Charles Kerr 2020-08-20 15:53:06 -05:00 committed by GitHub
parent 2d502b8ac6
commit d9a1c453ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 31 additions and 33 deletions

View file

@ -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());

View file

@ -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;

View file

@ -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 {