| 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/base/switches.h" |
| 7 #include "cc/layers/scrollbar_layer.h" | 8 #include "cc/layers/scrollbar_layer.h" |
| 8 #include "third_party/WebKit/public/platform/WebScrollbar.h" | 9 #include "third_party/WebKit/public/platform/WebScrollbar.h" |
| 9 #include "webkit/renderer/compositor_bindings/scrollbar_impl.h" | 10 #include "webkit/renderer/compositor_bindings/scrollbar_impl.h" |
| 10 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" | 11 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" |
| 11 | 12 |
| 12 using cc::ScrollbarLayer; | 13 using cc::ScrollbarLayer; |
| 13 | 14 |
| 14 namespace webkit { | 15 namespace webkit { |
| 15 | 16 |
| 16 WebScrollbarLayerImpl::WebScrollbarLayerImpl( | 17 WebScrollbarLayerImpl::WebScrollbarLayerImpl( |
| 17 WebKit::WebScrollbar* scrollbar, | 18 WebKit::WebScrollbar* scrollbar, |
| 18 WebKit::WebScrollbarThemePainter painter, | 19 WebKit::WebScrollbarThemePainter painter, |
| 19 WebKit::WebScrollbarThemeGeometry* geometry) | 20 WebKit::WebScrollbarThemeGeometry* geometry) |
| 20 : layer_(new WebLayerImpl(ScrollbarLayer::Create( | 21 : layer_(new WebLayerImpl( |
| 21 scoped_ptr<cc::Scrollbar>(new ScrollbarImpl( | 22 ScrollbarLayer::Create(scoped_ptr<cc::Scrollbar>(new ScrollbarImpl( |
| 22 make_scoped_ptr(scrollbar), | 23 make_scoped_ptr(scrollbar), |
| 23 painter, | 24 painter, |
| 24 make_scoped_ptr(geometry))).Pass(), 0))) {} | 25 make_scoped_ptr(geometry))).Pass(), |
| 26 0, |
| 27 cc::switches::ForceSolidColorScrollbars()))) {} |
| 25 | 28 |
| 26 WebScrollbarLayerImpl::~WebScrollbarLayerImpl() {} | 29 WebScrollbarLayerImpl::~WebScrollbarLayerImpl() {} |
| 27 | 30 |
| 28 WebKit::WebLayer* WebScrollbarLayerImpl::layer() { return layer_.get(); } | 31 WebKit::WebLayer* WebScrollbarLayerImpl::layer() { return layer_.get(); } |
| 29 | 32 |
| 30 void WebScrollbarLayerImpl::setScrollLayer(WebKit::WebLayer* layer) { | 33 void WebScrollbarLayerImpl::setScrollLayer(WebKit::WebLayer* layer) { |
| 31 int id = layer ? static_cast<WebLayerImpl*>(layer)->layer()->id() : 0; | 34 int id = layer ? static_cast<WebLayerImpl*>(layer)->layer()->id() : 0; |
| 32 static_cast<ScrollbarLayer*>(layer_->layer())->SetScrollLayerId(id); | 35 static_cast<ScrollbarLayer*>(layer_->layer())->SetScrollLayerId(id); |
| 33 } | 36 } |
| 34 | 37 |
| 35 } // namespace webkit | 38 } // namespace webkit |
| OLD | NEW |