| Index: ui/native_theme/native_theme_aura.cc
|
| diff --git a/ui/native_theme/native_theme_aura.cc b/ui/native_theme/native_theme_aura.cc
|
| index 0c3255cb18b6749ccadab206376634289dce1b76..76283878e06a13f8cb77b8adbc90799dfea2aa28 100644
|
| --- a/ui/native_theme/native_theme_aura.cc
|
| +++ b/ui/native_theme/native_theme_aura.cc
|
| @@ -35,6 +35,12 @@ namespace {
|
| constexpr int kOverlayScrollbarStrokeWidth = 1;
|
| constexpr int kOverlayScrollbarMinimumLength = 12;
|
|
|
| +// 2 pixel border with 1 pixel center patch. The border is 2 pixels despite the
|
| +// stroke width being 1 so that the inner pixel can match the center tile
|
| +// color. This prevents color interpolation between the patches.
|
| +constexpr int kOverlayScrollbarBorderPatchWidth = 2;
|
| +constexpr int kOverlayScrollbarCenterPatchSize = 1;
|
| +
|
| const SkColor kTrackColor = SkColorSetRGB(0xF1, 0xF1, 0xF1);
|
|
|
| } // namespace
|
| @@ -317,4 +323,27 @@ gfx::Size NativeThemeAura::GetPartSize(Part part,
|
| return NativeThemeBase::GetPartSize(part, state, extra);
|
| }
|
|
|
| +bool NativeThemeAura::SupportsNinePatch(Part part) const {
|
| + if (!IsOverlayScrollbarEnabled())
|
| + return false;
|
| +
|
| + return part == kScrollbarHorizontalThumb || part == kScrollbarVerticalThumb;
|
| +}
|
| +
|
| +gfx::Size NativeThemeAura::GetNinePatchCanvasSize(Part part) const {
|
| + DCHECK(SupportsNinePatch(part));
|
| +
|
| + return gfx::Size(
|
| + kOverlayScrollbarBorderPatchWidth * 2 + kOverlayScrollbarCenterPatchSize,
|
| + kOverlayScrollbarBorderPatchWidth * 2 + kOverlayScrollbarCenterPatchSize);
|
| +}
|
| +
|
| +gfx::Rect NativeThemeAura::GetNinePatchAperture(Part part) const {
|
| + DCHECK(SupportsNinePatch(part));
|
| +
|
| + return gfx::Rect(
|
| + kOverlayScrollbarBorderPatchWidth, kOverlayScrollbarBorderPatchWidth,
|
| + kOverlayScrollbarCenterPatchSize, kOverlayScrollbarCenterPatchSize);
|
| +}
|
| +
|
| } // namespace ui
|
|
|