Chromium Code Reviews| Index: Source/core/page/scrolling/ScrollingCoordinator.cpp |
| diff --git a/Source/core/page/scrolling/ScrollingCoordinator.cpp b/Source/core/page/scrolling/ScrollingCoordinator.cpp |
| index 68a4ddd5b6043e67311961ce598f018fdc64ee0a..cd69b4f1faf26d4cde158280239ff10f89640ae3 100644 |
| --- a/Source/core/page/scrolling/ScrollingCoordinator.cpp |
| +++ b/Source/core/page/scrolling/ScrollingCoordinator.cpp |
| @@ -34,6 +34,7 @@ |
| #include "core/page/Frame.h" |
| #include "core/page/FrameView.h" |
| #include "core/page/Page.h" |
| +#include "core/page/Settings.h" |
| #include "core/platform/PlatformWheelEvent.h" |
| #include "core/platform/ScrollAnimator.h" |
| #include "core/platform/ScrollbarTheme.h" |
| @@ -208,6 +209,13 @@ static PassOwnPtr<WebScrollbarLayer> createScrollbarLayer(Scrollbar* scrollbar) |
| return scrollbarLayer.release(); |
| } |
| +PassOwnPtr<WebScrollbarLayer> ScrollingCoordinator::createSolidColorScrollbarLayer(ScrollbarOrientation orientation, int thumbThickness) |
| +{ |
| + WebKit::WebScrollbar::Orientation webOrientation = (orientation == HorizontalScrollbar) ? WebKit::WebScrollbar::Horizontal : WebKit::WebScrollbar::Vertical; |
| + OwnPtr<WebScrollbarLayer> scrollbarLayer = adoptPtr(WebKit::Platform::current()->compositorSupport()->createSolidColorScrollbarLayer(webOrientation, thumbThickness)); |
| + return scrollbarLayer.release(); |
| +} |
| + |
| static void detachScrollbarLayer(GraphicsLayer* scrollbarGraphicsLayer) |
| { |
| ASSERT(scrollbarGraphicsLayer); |
| @@ -271,8 +279,17 @@ void ScrollingCoordinator::scrollableAreaScrollbarLayerDidChange(ScrollableArea* |
| } |
| WebScrollbarLayer* scrollbarLayer = getWebScrollbarLayer(scrollableArea, orientation); |
| - if (!scrollbarLayer) |
| - scrollbarLayer = addWebScrollbarLayer(scrollableArea, orientation, createScrollbarLayer(scrollbar)); |
| + if (!scrollbarLayer) { |
| + Settings* settings = m_page->mainFrame()->document()->settings(); |
| + bool shouldCreateSolidColorScrollbar = settings->useSolidColorScrollbars() && settings->usesOverlayScrollbars(); |
|
jamesr
2013/09/03 23:06:19
why are you checking usesSolidColor... *and* usesO
enne (OOO)
2013/09/03 23:47:33
My thought was that Android would set both of thes
wjmaclean
2013/09/04 13:27:59
I can confirm that Android does currently set both
jamesr
2013/09/04 20:41:17
I think either would be fine - either say that one
|
| + |
| + OwnPtr<WebScrollbarLayer> webScrollbarLayer; |
| + if (shouldCreateSolidColorScrollbar) |
| + webScrollbarLayer = createSolidColorScrollbarLayer(orientation, -1); |
| + else |
| + webScrollbarLayer = createScrollbarLayer(scrollbar); |
| + addWebScrollbarLayer(scrollableArea, orientation, webScrollbarLayer.release()); |
| + } |
| // Root layer non-overlay scrollbars should be marked opaque to disable |
| // blending. |