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

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: 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..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.
« 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