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..30ba2b9554699d95115ee07d6d3ed8f1506b2dd7 100644 |
--- a/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp |
+++ b/third_party/WebKit/Source/platform/scroll/ScrollbarThemeOverlay.cpp |
@@ -236,4 +236,38 @@ 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 = |
+ scrollbar.orientation() == VerticalScrollbar |
+ ? WebThemeEngine::PartScrollbarVerticalThumb |
+ : WebThemeEngine::PartScrollbarHorizontalThumb; |
+ |
+ 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 |