Commit 00de8c6d authored by Kurt Catti-Schmidt's avatar Kurt Catti-Schmidt Committed by Commit Bot

Update system colors dynamically

This change exposes LayoutTheme::PlatformColorsDidChange() through
WebRenderTheme. This allows system colors to update dynamically when
new colors are sent from the browser process.

Bug: 970285
Change-Id: Ic3b75dfec668dc5523b0e12765574e66dd35ff8f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1797057Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Commit-Queue: Kurt Catti-Schmidt <kschmi@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#700308}
parent 41e71f90
......@@ -150,6 +150,7 @@
#include "third_party/blink/public/web/blink.h"
#include "third_party/blink/public/web/web_document.h"
#include "third_party/blink/public/web/web_frame.h"
#include "third_party/blink/public/web/web_render_theme.h"
#include "third_party/blink/public/web/web_script_controller.h"
#include "third_party/blink/public/web/web_security_policy.h"
#include "third_party/blink/public/web/web_view.h"
......@@ -2160,6 +2161,7 @@ void RenderThreadImpl::UpdateSystemColorInfo(
ui::NativeTheme::GetInstanceForWeb()->UpdateSystemColorInfo(
params->is_dark_mode, params->is_high_contrast,
params->preferred_color_scheme, params->colors);
blink::SystemColorsChanged();
}
void RenderThreadImpl::PurgePluginListCache(bool reload_pages) {
......
......@@ -47,6 +47,8 @@ BLINK_EXPORT void SetSelectionColors(unsigned active_background_color,
unsigned inactive_background_color,
unsigned inactive_foreground_color);
BLINK_EXPORT void SystemColorsChanged();
} // namespace blink
#endif
......@@ -53,4 +53,8 @@ void SetSelectionColors(unsigned active_background_color,
inactive_background_color, inactive_foreground_color);
}
void SystemColorsChanged() {
LayoutTheme::GetTheme().PlatformColorsDidChange();
}
} // namespace blink
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment