#include "ui/native_theme/native_theme_aura.h"
#include <limits>
#include <utility>
#include "base/check_op.h"
#include "base/containers/fixed_flat_map.h"
#include "base/no_destructor.h"
#include "base/notreached.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "cc/paint/paint_canvas.h"
#include "cc/paint/paint_flags.h"
#include "third_party/skia/include/core/SkPath.h"
#include "ui/base/ui_base_features.h"
#include "ui/color/color_provider.h"
#include "ui/gfx/animation/tween.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rrect_f.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/geometry/skia_conversions.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/native_theme/common_theme.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/native_theme_fluent.h"
#include "ui/native_theme/overlay_scrollbar_constants_aura.h"
namespace ui {
namespace {
constexpr int kOverlayScrollbarMinimumLength = …;
constexpr int kOverlayScrollbarBorderPatchWidth = …;
constexpr int kOverlayScrollbarCenterPatchSize = …;
const SkScalar kScrollbarArrowRadius = …;
BASE_FEATURE(…);
}
#if !BUILDFLAG(IS_APPLE)
NativeTheme* NativeTheme::GetInstanceForWeb() { … }
#if !BUILDFLAG(IS_WIN)
NativeTheme* NativeTheme::GetInstanceForNativeUi() { … }
NativeTheme* NativeTheme::GetInstanceForDarkUI() { … }
#endif
#endif
NativeThemeAura::NativeThemeAura(bool use_overlay_scrollbars,
bool should_only_use_dark_colors,
ui::SystemTheme system_theme,
bool configure_web_instance)
: … { … }
NativeThemeAura::~NativeThemeAura() { … }
NativeThemeAura* NativeThemeAura::web_instance() { … }
SkColor4f NativeThemeAura::FocusRingColorForBaseColor(
SkColor4f base_color) const { … }
void NativeThemeAura::ConfigureWebInstance() { … }
void NativeThemeAura::PaintMenuPopupBackground(
cc::PaintCanvas* canvas,
const ColorProvider* color_provider,
const gfx::Size& size,
const MenuBackgroundExtraParams& menu_background,
ColorScheme color_scheme) const { … }
void NativeThemeAura::PaintMenuItemBackground(
cc::PaintCanvas* canvas,
const ColorProvider* color_provider,
State state,
const gfx::Rect& rect,
const MenuItemExtraParams& menu_item,
ColorScheme color_scheme) const { … }
void NativeThemeAura::PaintArrowButton(
cc::PaintCanvas* canvas,
const ColorProvider* color_provider,
const gfx::Rect& rect,
Part direction,
State state,
ColorScheme color_scheme,
bool in_forced_colors,
const ScrollbarArrowExtraParams& extra_params) const { … }
void NativeThemeAura::PaintScrollbarTrack(
cc::PaintCanvas* canvas,
const ColorProvider* color_provider,
Part part,
State state,
const ScrollbarTrackExtraParams& extra_params,
const gfx::Rect& rect,
ColorScheme color_scheme,
bool in_forced_colors) const { … }
void NativeThemeAura::PaintScrollbarThumb(
cc::PaintCanvas* canvas,
const ColorProvider* color_provider,
Part part,
State state,
const gfx::Rect& rect,
const ScrollbarThumbExtraParams& extra_params,
ColorScheme color_scheme) const { … }
gfx::Insets NativeThemeAura::GetScrollbarSolidColorThumbInsets(
Part part) const { … }
SkColor4f NativeThemeAura::GetScrollbarThumbColor(
const ui::ColorProvider& color_provider,
State state,
const ScrollbarThumbExtraParams& extra_params) const { … }
void NativeThemeAura::PaintScrollbarCorner(
cc::PaintCanvas* canvas,
const ColorProvider* color_provider,
State state,
const gfx::Rect& rect,
const ScrollbarTrackExtraParams& extra_params,
ColorScheme color_scheme) const { … }
gfx::Size NativeThemeAura::GetPartSize(Part part,
State state,
const ExtraParams& extra) const { … }
void NativeThemeAura::DrawPartiallyRoundRect(cc::PaintCanvas* canvas,
const gfx::Rect& rect,
const SkScalar upper_left_radius,
const SkScalar upper_right_radius,
const SkScalar lower_right_radius,
const SkScalar lower_left_radius,
const cc::PaintFlags& flags) { … }
bool NativeThemeAura::SupportsNinePatch(Part part) const { … }
gfx::Size NativeThemeAura::GetNinePatchCanvasSize(Part part) const { … }
gfx::Rect NativeThemeAura::GetNinePatchAperture(Part part) const { … }
}