OLD | NEW |
| (Empty) |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "webkit/compositor_bindings/web_scrollbar_layer_impl.h" | |
6 | |
7 #include "cc/layers/scrollbar_layer.h" | |
8 #include "webkit/compositor_bindings/web_layer_impl.h" | |
9 #include "webkit/compositor_bindings/web_to_ccscrollbar_theme_painter_adapter.h" | |
10 | |
11 using cc::ScrollbarLayer; | |
12 using cc::ScrollbarThemePainter; | |
13 using WebKit::WebScrollbarThemePainter; | |
14 | |
15 namespace webkit { | |
16 | |
17 WebScrollbarLayerImpl::WebScrollbarLayerImpl( | |
18 WebKit::WebScrollbar* scrollbar, | |
19 WebKit::WebScrollbarThemePainter painter, | |
20 WebKit::WebScrollbarThemeGeometry* geometry) | |
21 : layer_(new WebLayerImpl(ScrollbarLayer::Create( | |
22 make_scoped_ptr(scrollbar), | |
23 WebToCCScrollbarThemePainterAdapter::Create( | |
24 make_scoped_ptr(new WebScrollbarThemePainter(painter))) | |
25 .PassAs<ScrollbarThemePainter>(), | |
26 make_scoped_ptr(geometry), | |
27 0))) {} | |
28 | |
29 WebScrollbarLayerImpl::~WebScrollbarLayerImpl() {} | |
30 | |
31 WebKit::WebLayer* WebScrollbarLayerImpl::layer() { return layer_.get(); } | |
32 | |
33 void WebScrollbarLayerImpl::setScrollLayer(WebKit::WebLayer* layer) { | |
34 int id = layer ? static_cast<WebLayerImpl*>(layer)->layer()->id() : 0; | |
35 static_cast<ScrollbarLayer*>(layer_->layer())->SetScrollLayerId(id); | |
36 } | |
37 | |
38 } // namespace webkit | |
OLD | NEW |