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