Chromium Code Reviews| 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..4b12db1a68a7e0dffcd63b14661465a5b5f3944b 100644 |
| --- a/ui/native_theme/native_theme_aura.cc |
| +++ b/ui/native_theme/native_theme_aura.cc |
| @@ -317,4 +317,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)); |
| + |
| + // 2 pixel border with 1 pixel center patch. |
|
Evan Stade
2017/03/01 16:45:49
2 pixels or 2 dip? Why 2 pixels if OverlayScrollba
bokan
2017/03/01 17:02:31
It's to prevent color interpolation between the pa
|
| + return gfx::Size(5, 5); |
|
Evan Stade
2017/03/01 16:45:49
can you pull out these values into named constants
bokan
2017/03/01 17:02:31
Done.
|
| +} |
| + |
| +gfx::Rect NativeThemeAura::GetNinePatchAperture(Part part) const { |
| + DCHECK(SupportsNinePatch(part)); |
| + |
| + // The aperture is a single pixel surrounded by a non-resizing 2 pixel border. |
| + // The stroke is actually only 1 pixel wide but we need to use 2 pixels so |
| + // that the center patch doesn't try to blend colors between patches. |
| + return gfx::Rect(2, 2, 1, 1); |
|
Evan Stade
2017/03/01 16:45:49
ditto
bokan
2017/03/01 17:02:31
Done.
|
| +} |
| + |
| } // namespace ui |