#include "third_party/blink/renderer/core/paint/theme_painter_default.h"
#include "third_party/abseil-cpp/absl/types/variant.h"
#include "third_party/blink/public/platform/web_theme_engine.h"
#include "third_party/blink/public/resources/grit/blink_image_resources.h"
#include "third_party/blink/renderer/core/dom/shadow_root.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/html/forms/html_input_element.h"
#include "third_party/blink/renderer/core/html/forms/slider_thumb_element.h"
#include "third_party/blink/renderer/core/html/forms/spin_button_element.h"
#include "third_party/blink/renderer/core/html/shadow/shadow_element_names.h"
#include "third_party/blink/renderer/core/layout/layout_object.h"
#include "third_party/blink/renderer/core/layout/layout_progress.h"
#include "third_party/blink/renderer/core/layout/layout_theme_default.h"
#include "third_party/blink/renderer/core/page/chrome_client.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/paint/paint_auto_dark_mode.h"
#include "third_party/blink/renderer/core/paint/paint_info.h"
#include "third_party/blink/renderer/platform/graphics/color.h"
#include "third_party/blink/renderer/platform/graphics/graphics_context.h"
#include "third_party/blink/renderer/platform/graphics/graphics_context_state_saver.h"
#include "third_party/blink/renderer/platform/text/writing_mode.h"
#include "third_party/blink/renderer/platform/theme/web_theme_engine_helper.h"
#include "ui/base/ui_base_features.h"
#include "ui/color/color_provider.h"
#include "ui/gfx/color_utils.h"
#include "ui/native_theme/native_theme.h"
namespace blink {
namespace {
bool IsIndeterminate(const Element& element) { … }
bool IsChecked(const Element& element) { … }
WebThemeEngine::State GetWebThemeState(const Element& element) { … }
SkColor GetContrastingColorFor(const Element& element,
const mojom::ColorScheme color_scheme,
WebThemeEngine::Part part) { … }
mojom::ColorScheme CalculateColorSchemeForAccentColor(
std::optional<SkColor> accent_color,
mojom::ColorScheme color_scheme,
SkColor light_contrasting_color,
SkColor dark_contrasting_color) { … }
mojom::blink::ColorScheme GetColorSchemeForAccentColor(
const Element& element,
const mojom::blink::ColorScheme color_scheme,
const std::optional<SkColor> accent_color,
WebThemeEngine::Part part) { … }
class DirectionFlippingScope { … };
DirectionFlippingScope::DirectionFlippingScope(
const LayoutObject& layout_object,
const PaintInfo& paint_info,
const gfx::Rect& rect)
: … { … }
DirectionFlippingScope::~DirectionFlippingScope() { … }
gfx::Rect DeterminateProgressValueRectFor(const LayoutProgress& layout_progress,
const gfx::Rect& rect) { … }
gfx::Rect IndeterminateProgressValueRectFor(
const LayoutProgress& layout_progress,
const gfx::Rect& rect) { … }
gfx::Rect ProgressValueRectFor(const LayoutProgress& layout_progress,
const gfx::Rect& rect) { … }
gfx::Rect ConvertToPaintingRect(const LayoutObject& input_layout_object,
const LayoutObject& part_layout_object,
PhysicalRect part_rect,
const gfx::Rect& local_offset) { … }
std::optional<SkColor> GetAccentColor(const ComputedStyle& style,
const Document& document) { … }
}
ThemePainterDefault::ThemePainterDefault(LayoutThemeDefault& theme)
: … { … }
bool ThemePainterDefault::PaintCheckbox(const Element& element,
const Document& document,
const ComputedStyle& style,
const PaintInfo& paint_info,
const gfx::Rect& rect) { … }
bool ThemePainterDefault::PaintRadio(const Element& element,
const Document& document,
const ComputedStyle& style,
const PaintInfo& paint_info,
const gfx::Rect& rect) { … }
bool ThemePainterDefault::PaintButton(const Element& element,
const Document& document,
const ComputedStyle& style,
const PaintInfo& paint_info,
const gfx::Rect& rect) { … }
bool ThemePainterDefault::PaintTextField(const Element& element,
const ComputedStyle& style,
const PaintInfo& paint_info,
const gfx::Rect& rect) { … }
bool ThemePainterDefault::PaintMenuList(const Element& element,
const Document& document,
const ComputedStyle& style,
const PaintInfo& paint_info,
const gfx::Rect& rect) { … }
bool ThemePainterDefault::PaintMenuListButton(const Element& element,
const Document& document,
const ComputedStyle& style,
const PaintInfo& paint_info,
const gfx::Rect& rect) { … }
void ThemePainterDefault::SetupMenuListArrow(
const Document& document,
const ComputedStyle& style,
const gfx::Rect& rect,
WebThemeEngine::ExtraParams& extra_params) { … }
bool ThemePainterDefault::PaintSliderTrack(const Element& element,
const LayoutObject& layout_object,
const PaintInfo& paint_info,
const gfx::Rect& rect,
const ComputedStyle& style) { … }
bool ThemePainterDefault::PaintSliderThumb(const Element& element,
const ComputedStyle& style,
const PaintInfo& paint_info,
const gfx::Rect& rect) { … }
bool ThemePainterDefault::PaintInnerSpinButton(const Element& element,
const ComputedStyle& style,
const PaintInfo& paint_info,
const gfx::Rect& rect) { … }
bool ThemePainterDefault::PaintProgressBar(const Element& element,
const LayoutObject& layout_object,
const PaintInfo& paint_info,
const gfx::Rect& rect,
const ComputedStyle& style) { … }
bool ThemePainterDefault::PaintTextArea(const Element& element,
const ComputedStyle& style,
const PaintInfo& paint_info,
const gfx::Rect& rect) { … }
bool ThemePainterDefault::PaintSearchField(const Element& element,
const ComputedStyle& style,
const PaintInfo& paint_info,
const gfx::Rect& rect) { … }
bool ThemePainterDefault::PaintSearchFieldCancelButton(
const LayoutObject& cancel_button_object,
const PaintInfo& paint_info,
const gfx::Rect& r) { … }
gfx::Rect ThemePainterDefault::ApplyZoomToRect(
const gfx::Rect& rect,
const PaintInfo& paint_info,
GraphicsContextStateSaver& state_saver,
float zoom_level) { … }
}