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/renderer/compositor_bindings/web_scrollbar_layer_impl.h" | 5 #include "webkit/renderer/compositor_bindings/web_scrollbar_layer_impl.h" |
6 | 6 |
7 #include "cc/layers/layer.h" | |
8 #include "cc/layers/painted_scrollbar_layer.h" | 7 #include "cc/layers/painted_scrollbar_layer.h" |
9 #include "cc/layers/scrollbar_layer_interface.h" | 8 #include "cc/layers/scrollbar_layer_interface.h" |
10 #include "cc/layers/solid_color_scrollbar_layer.h" | 9 #include "cc/layers/solid_color_scrollbar_layer.h" |
11 #include "webkit/renderer/compositor_bindings/scrollbar_impl.h" | 10 #include "webkit/renderer/compositor_bindings/scrollbar_impl.h" |
12 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" | 11 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" |
13 | 12 |
14 using cc::PaintedScrollbarLayer; | 13 using cc::PaintedScrollbarLayer; |
15 using cc::SolidColorScrollbarLayer; | 14 using cc::SolidColorScrollbarLayer; |
16 | 15 |
17 namespace { | 16 namespace { |
(...skipping 27 matching lines...) Expand all Loading... |
45 ConvertOrientation(orientation), | 44 ConvertOrientation(orientation), |
46 thumb_thickness, | 45 thumb_thickness, |
47 is_left_side_vertical_scrollbar, | 46 is_left_side_vertical_scrollbar, |
48 0))) {} | 47 0))) {} |
49 | 48 |
50 WebScrollbarLayerImpl::~WebScrollbarLayerImpl() {} | 49 WebScrollbarLayerImpl::~WebScrollbarLayerImpl() {} |
51 | 50 |
52 blink::WebLayer* WebScrollbarLayerImpl::layer() { return layer_.get(); } | 51 blink::WebLayer* WebScrollbarLayerImpl::layer() { return layer_.get(); } |
53 | 52 |
54 void WebScrollbarLayerImpl::setScrollLayer(blink::WebLayer* layer) { | 53 void WebScrollbarLayerImpl::setScrollLayer(blink::WebLayer* layer) { |
55 cc::Layer* scroll_layer = | 54 int id = layer ? static_cast<WebLayerImpl*>(layer)->layer()->id() : 0; |
56 layer ? static_cast<WebLayerImpl*>(layer)->layer() : 0; | 55 static_cast<PaintedScrollbarLayer*>(layer_->layer())->SetScrollLayerId(id); |
57 layer_->layer()->ToScrollbarLayer()->SetScrollLayer(scroll_layer); | |
58 } | |
59 | |
60 void WebScrollbarLayerImpl::setClipLayer(blink::WebLayer* layer) { | |
61 cc::Layer* clip_layer = | |
62 layer ? static_cast<WebLayerImpl*>(layer)->layer() : 0; | |
63 layer_->layer()->ToScrollbarLayer() | |
64 ->SetClipLayer(clip_layer); | |
65 } | 56 } |
66 | 57 |
67 } // namespace webkit | 58 } // namespace webkit |
OLD | NEW |