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..f1e68aac472e532b4eff970cc59978b14c9aff5d 100644 |
--- a/webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc |
+++ b/webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.cc |
@@ -4,12 +4,12 @@ |
#include "webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.h" |
+#include "cc/input/viewport_scrollbar.h" |
#include "cc/layers/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::ViewportScrollbar; |
namespace webkit { |
@@ -23,6 +23,22 @@ WebScrollbarLayerImpl::WebScrollbarLayerImpl( |
painter, |
make_scoped_ptr(geometry))).Pass(), 0))) {} |
+WebScrollbarLayerImpl::WebScrollbarLayerImpl( |
enne (OOO)
2013/06/12 19:44:38
I am not really sure this is in line with what I w
wjmaclean
2013/06/12 19:54:36
By "behave identically" you mean using cc:Scrollba
trchen
2013/06/12 21:22:11
I agree with enne@ that we should avoid adding new
|
+ WebKit::WebLayer* scroll_layer, |
+ WebKit::WebScrollbar::Orientation orientation, |
+ size_t thickness) |
+ : layer_(new WebLayerImpl(ScrollbarLayer::Create( |
+ scoped_ptr<cc::Scrollbar>(new ViewportScrollbar( |
+ static_cast<WebLayerImpl*>(scroll_layer)->layer(), |
+ orientation == WebKit::WebScrollbar::Horizontal ? cc::HORIZONTAL |
+ : cc::VERTICAL, |
+ thickness)), |
+ 0))) { |
+ // Do this here to be consistent with the layer passed to the |
+ // ViewportScrollbar. |
+ setScrollLayer(scroll_layer); |
+} |
+ |
WebScrollbarLayerImpl::~WebScrollbarLayerImpl() {} |
WebKit::WebLayer* WebScrollbarLayerImpl::layer() { return layer_.get(); } |