diff --git a/browser/farbling/brave_dark_mode_fingerprint_protection_browsertest.cc b/browser/farbling/brave_dark_mode_fingerprint_protection_browsertest.cc index 37b88677c7b..e55e7591f61 100644 --- a/browser/farbling/brave_dark_mode_fingerprint_protection_browsertest.cc +++ b/browser/farbling/brave_dark_mode_fingerprint_protection_browsertest.cc @@ -30,7 +30,7 @@ #include "ui/color/color_provider_key.h" #include "ui/color/color_provider_manager.h" #include "ui/color/color_provider_source.h" -#include "ui/native_theme/test_native_theme.h" +#include "ui/native_theme/mock_os_settings_provider.h" using brave_shields::ControlType; using brave_shields::features::kBraveDarkModeBlock; @@ -46,19 +46,6 @@ class BraveDarkModeFingerprintProtectionTest : public InProcessBrowserTest { brave_shields::features::kBraveShowStrictFingerprintingMode); } - class BraveContentBrowserClientWithWebTheme - : public BraveContentBrowserClient { - public: - explicit BraveContentBrowserClientWithWebTheme(const ui::NativeTheme* theme) - : theme_(theme) {} - - protected: - const ui::NativeTheme* GetWebTheme() const override { return theme_; } - - private: - const raw_ptr theme_; - }; - class MockColorProviderSource : public ui::ColorProviderSource { public: explicit MockColorProviderSource(bool is_dark) { @@ -95,9 +82,6 @@ class BraveDarkModeFingerprintProtectionTest : public InProcessBrowserTest { void SetUpOnMainThread() override { InProcessBrowserTest::SetUpOnMainThread(); - content::SetBrowserClientForTesting( - new BraveContentBrowserClientWithWebTheme(&test_theme_)); - host_resolver()->AddRule("*", "127.0.0.1"); content::SetupCrossSiteRedirector(embedded_test_server()); @@ -135,7 +119,7 @@ class BraveDarkModeFingerprintProtectionTest : public InProcessBrowserTest { } void SetDarkMode(bool dark_mode) { - test_theme_.SetPreferredColorScheme( + os_settings_provider_.SetPreferredColorScheme( dark_mode ? ui::NativeTheme::PreferredColorScheme::kDark : ui::NativeTheme::PreferredColorScheme::kLight); browser() @@ -175,7 +159,7 @@ class BraveDarkModeFingerprintProtectionTest : public InProcessBrowserTest { } protected: - ui::TestNativeTheme test_theme_; + ui::MockOsSettingsProvider os_settings_provider_; MockColorProviderSource dark_color_provider_source_{true}; MockColorProviderSource light_color_provider_source_{false}; diff --git a/chromium_src/ui/native_theme/native_theme_win.cc b/chromium_src/ui/native_theme/native_theme_win.cc index 8e7f5b38925..d2101257073 100644 --- a/chromium_src/ui/native_theme/native_theme_win.cc +++ b/chromium_src/ui/native_theme/native_theme_win.cc @@ -7,13 +7,7 @@ namespace { bool s_ignore_system_dark_mode_change = false; } // namespace -#define BRAVE_NATIVETHEMEWIN_UPDATEDARKMODESTATUS \ - if (s_ignore_system_dark_mode_change) { \ - return; \ - } - #include -#undef BRAVE_NATIVETHEMEWIN_UPDATEDARKMODESTATUS namespace ui { diff --git a/patches/ui-native_theme-native_theme_win.cc.patch b/patches/ui-native_theme-native_theme_win.cc.patch deleted file mode 100644 index 80d38ce639c..00000000000 --- a/patches/ui-native_theme-native_theme_win.cc.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc -index 7468404c730c68bc8ba7565bf613aa69f13e3095..544b547ef365ad2eb8dc8c40e943bbaa3ad696ba 100644 ---- a/ui/native_theme/native_theme_win.cc -+++ b/ui/native_theme/native_theme_win.cc -@@ -1669,6 +1669,7 @@ void NativeThemeWin::UpdateDarkModeStatus() { - &apps_use_light_theme); - in_dark_mode_ = (apps_use_light_theme == 0); - } -+ BRAVE_NATIVETHEMEWIN_UPDATEDARKMODESTATUS - set_preferred_color_scheme(CalculatePreferredColorScheme()); - CloseHandlesInternal(); - NotifyOnNativeThemeUpdated();