Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1279)

Unified Diff: Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 23620023: Add ability to create solid color scrollbars in ScrollingCoordinator. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Check useSolidColorScrollbar() and ASSERT on usesOverlayScrollbars(). Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/page/scrolling/ScrollingCoordinator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..58e4d2463754ed218d2bbdfa4fa9f6d67ea08d30 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,18 @@ 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();
+
+ OwnPtr<WebScrollbarLayer> webScrollbarLayer;
+ if (settings->useSolidColorScrollbars()) {
+ ASSERT(settings->usesOverlayScrollbars());
+ webScrollbarLayer = createSolidColorScrollbarLayer(orientation, -1);
+ } else {
+ webScrollbarLayer = createScrollbarLayer(scrollbar);
+ }
+ scrollbarLayer = addWebScrollbarLayer(scrollableArea, orientation, webScrollbarLayer.release());
+ }
// Root layer non-overlay scrollbars should be marked opaque to disable
// blending.
« no previous file with comments | « Source/core/page/scrolling/ScrollingCoordinator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698