feat: add {get|set}AccentColor on Windows (#47741)

* feat: add setAccentColor on Windows

* refactor: unify GetSystemAccentColor

* refactor: remove redundant parsing

* chore: fixup documentation

* Update docs/api/browser-window.md

Co-authored-by: Will Anderson <andersonw@dropbox.com>

* Update docs/api/base-window.md

Co-authored-by: Will Anderson <andersonw@dropbox.com>

---------

Co-authored-by: Will Anderson <andersonw@dropbox.com>
This commit is contained in:
Shelley Vohr 2025-08-01 22:29:02 +02:00 committed by GitHub
commit 5c98e3609f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 265 additions and 24 deletions

View file

@ -347,6 +347,10 @@ class NativeWindow : public base::SupportsUserData,
#if BUILDFLAG(IS_WIN)
void NotifyWindowMessage(UINT message, WPARAM w_param, LPARAM l_param);
virtual void SetAccentColor(
std::variant<std::monostate, bool, SkColor> accent_color) = 0;
virtual std::variant<bool, std::string> GetAccentColor() const = 0;
virtual void UpdateWindowAccentColor(bool active) = 0;
#endif
void AddObserver(NativeWindowObserver* obs) { observers_.AddObserver(obs); }