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