#include "third_party/blink/renderer/platform/theme/web_theme_engine_default.h"
#include "build/build_config.h"
#include "skia/ext/platform_canvas.h"
#include "third_party/abseil-cpp/absl/types/variant.h"
#include "third_party/blink/public/platform/web_theme_engine.h"
#include "third_party/blink/renderer/platform/graphics/scrollbar_theme_settings.h"
#include "third_party/blink/renderer/platform/theme/web_theme_engine_conversions.h"
#include "third_party/blink/renderer/platform/web_test_support.h"
#include "third_party/blink/renderer/platform/wtf/casting.h"
#include "ui/color/color_provider_utils.h"
#include "ui/gfx/color_palette.h"
#include "ui/native_theme/native_theme.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/overlay_scrollbar_constants_aura.h"
namespace blink {
ColorScheme;
namespace {
#if BUILDFLAG(IS_WIN)
int32_t g_vertical_scroll_bar_width;
int32_t g_horizontal_scroll_bar_height;
int32_t g_vertical_arrow_bitmap_height;
int32_t g_horizontal_arrow_bitmap_width;
#endif
}
static ui::NativeTheme::ExtraParams GetNativeThemeExtraParams(
WebThemeEngine::Part part,
WebThemeEngine::State state,
const WebThemeEngine::ExtraParams* extra_params) { … }
WebThemeEngineDefault::WebThemeEngineDefault() = default;
WebThemeEngineDefault::~WebThemeEngineDefault() = default;
gfx::Size WebThemeEngineDefault::GetSize(WebThemeEngine::Part part) { … }
void WebThemeEngineDefault::Paint(
cc::PaintCanvas* canvas,
WebThemeEngine::Part part,
WebThemeEngine::State state,
const gfx::Rect& rect,
const WebThemeEngine::ExtraParams* extra_params,
mojom::ColorScheme color_scheme,
bool in_forced_colors,
const ui::ColorProvider* color_provider,
const std::optional<SkColor>& accent_color) { … }
gfx::Insets WebThemeEngineDefault::GetScrollbarSolidColorThumbInsets(
Part part) const { … }
SkColor4f WebThemeEngineDefault::GetScrollbarThumbColor(
WebThemeEngine::State state,
const WebThemeEngine::ExtraParams* extra_params,
const ui::ColorProvider* color_provider) const { … }
void WebThemeEngineDefault::GetOverlayScrollbarStyle(ScrollbarStyle* style) { … }
bool WebThemeEngineDefault::SupportsNinePatch(Part part) const { … }
gfx::Size WebThemeEngineDefault::NinePatchCanvasSize(Part part) const { … }
gfx::Rect WebThemeEngineDefault::NinePatchAperture(Part part) const { … }
bool WebThemeEngineDefault::IsFluentScrollbarEnabled() const { … }
bool WebThemeEngineDefault::IsFluentOverlayScrollbarEnabled() const { … }
int WebThemeEngineDefault::GetPaintedScrollbarTrackInset() const { … }
std::optional<SkColor> WebThemeEngineDefault::GetAccentColor() const { … }
#if BUILDFLAG(IS_WIN)
void WebThemeEngineDefault::cacheScrollBarMetrics(
int32_t vertical_scroll_bar_width,
int32_t horizontal_scroll_bar_height,
int32_t vertical_arrow_bitmap_height,
int32_t horizontal_arrow_bitmap_width) {
g_vertical_scroll_bar_width = vertical_scroll_bar_width;
g_horizontal_scroll_bar_height = horizontal_scroll_bar_height;
g_vertical_arrow_bitmap_height = vertical_arrow_bitmap_height;
g_horizontal_arrow_bitmap_width = horizontal_arrow_bitmap_width;
}
#endif
}