Chromium Code Reviews| Index: third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp |
| diff --git a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp |
| index 9753dcc192827a0a56e415c39e9afe1f31795f66..532136f23bb54c35d575b8049de028b1d8ae93b1 100644 |
| --- a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp |
| +++ b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp |
| @@ -236,4 +236,37 @@ ScrollbarThemeOverlay& ScrollbarThemeOverlay::mobileTheme() { |
| return *theme; |
| } |
| +bool ScrollbarThemeOverlay::usesNinePatchThumbResource() const { |
| + WebThemeEngine* engine = Platform::current()->themeEngine(); |
| + if (!engine) |
| + return false; |
| + |
| + // Thumb orientation doesn't matter here. |
| + return engine->supportsNinePatch(WebThemeEngine::PartScrollbarVerticalThumb); |
| +} |
| + |
| +IntSize ScrollbarThemeOverlay::ninePatchThumbCanvasSize( |
| + const ScrollbarThemeClient& scrollbar) const { |
| + DCHECK(usesNinePatchThumbResource()); |
| + |
| + WebThemeEngine::Part part = WebThemeEngine::PartScrollbarHorizontalThumb; |
|
jbroman
2017/03/01 15:27:18
super-nit: for something this simple why not a ter
bokan
2017/03/01 16:22:45
Done.
|
| + if (scrollbar.orientation() == VerticalScrollbar) |
| + part = WebThemeEngine::PartScrollbarVerticalThumb; |
| + |
| + DCHECK(Platform::current()->themeEngine()); |
| + return Platform::current()->themeEngine()->ninePatchCanvasSize(part); |
| +} |
| + |
| +IntRect ScrollbarThemeOverlay::ninePatchThumbAperture( |
| + const ScrollbarThemeClient& scrollbar) const { |
| + DCHECK(usesNinePatchThumbResource()); |
| + |
| + WebThemeEngine::Part part = WebThemeEngine::PartScrollbarHorizontalThumb; |
| + if (scrollbar.orientation() == VerticalScrollbar) |
| + part = WebThemeEngine::PartScrollbarVerticalThumb; |
| + |
| + DCHECK(Platform::current()->themeEngine()); |
| + return Platform::current()->themeEngine()->ninePatchAperture(part); |
| +} |
| + |
| } // namespace blink |