Index: webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc |
diff --git a/webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc b/webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc |
index a8080212beb7ba55e548044a884ba70ec6fa86ad..db0487f67b50ce9bd4100d4d0438d366c6b497e2 100644 |
--- a/webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc |
+++ b/webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc |
@@ -5,11 +5,31 @@ |
#include "webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.h" |
#include "cc/layers/scrollbar_layer.h" |
+#include "cc/layers/scrollbar_layer_base.h" |
+#include "cc/layers/solid_color_scrollbar_layer.h" |
#include "third_party/WebKit/public/platform/WebScrollbar.h" |
#include "webkit/renderer/compositor_bindings/scrollbar_impl.h" |
#include "webkit/renderer/compositor_bindings/web_layer_impl.h" |
using cc::ScrollbarLayer; |
+using cc::SolidColorScrollbarLayer; |
+ |
+#if defined(OS_ANDROID) |
+namespace { |
+ |
+cc::ScrollbarOrientation convertOrientation( |
tfarina
2013/07/04 17:34:45
CamelCase
wjmaclean
2013/07/04 17:50:11
Done.
|
+ WebKit::WebScrollbar::Orientation orientation) { |
+ if (orientation == WebKit::WebScrollbar::Horizontal) |
tfarina
2013/07/04 17:34:45
I know if/else is clear, but I'd just use the tern
wjmaclean
2013/07/04 17:50:11
Done.
|
+ return cc::HORIZONTAL; |
+ else |
+ return cc::VERTICAL; |
+} |
+ |
+const int solid_color_scrollbar_thumb_thickness = 3; |
tfarina
2013/07/04 17:34:45
kFoo
wjmaclean
2013/07/04 17:50:11
Done.
|
+const SkColor solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128); |
tfarina
2013/07/04 17:34:45
kFoo
wjmaclean
2013/07/04 17:50:11
Done.
|
+ |
+} // namespace |
+#endif |
namespace webkit { |
@@ -17,11 +37,19 @@ WebScrollbarLayerImpl::WebScrollbarLayerImpl( |
WebKit::WebScrollbar* scrollbar, |
WebKit::WebScrollbarThemePainter painter, |
WebKit::WebScrollbarThemeGeometry* geometry) |
+#if defined(OS_ANDROID) |
+ : layer_(new WebLayerImpl(SolidColorScrollbarLayer::Create( |
+ convertOrientation(scrollbar->orientation()), |
+ solid_color_scrollbar_thumb_thickness, |
+ solid_color_scrollbar_color, |
+ 0))) {} |
+#else |
: layer_(new WebLayerImpl(ScrollbarLayer::Create( |
scoped_ptr<cc::Scrollbar>(new ScrollbarImpl( |
make_scoped_ptr(scrollbar), |
painter, |
make_scoped_ptr(geometry))).Pass(), 0))) {} |
+#endif |
WebScrollbarLayerImpl::~WebScrollbarLayerImpl() {} |
@@ -29,7 +57,7 @@ WebKit::WebLayer* WebScrollbarLayerImpl::layer() { return layer_.get(); } |
void WebScrollbarLayerImpl::setScrollLayer(WebKit::WebLayer* layer) { |
int id = layer ? static_cast<WebLayerImpl*>(layer)->layer()->id() : 0; |
- static_cast<ScrollbarLayer*>(layer_->layer())->SetScrollLayerId(id); |
+ layer_->layer()->ToScrollbarLayerBase()->SetScrollLayerId(id); |
} |
} // namespace webkit |