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 "config.h" | 5 #include "config.h" |
6 #include "WebScrollbarLayerImpl.h" | 6 #include "WebScrollbarLayerImpl.h" |
7 | 7 |
8 #include "ScrollbarLayerChromium.h" | 8 #include "ScrollbarLayerChromium.h" |
9 #include "WebLayerImpl.h" | 9 #include "WebLayerImpl.h" |
10 | 10 |
11 using WebCore::Scrollbar; | |
12 using WebCore::ScrollbarLayerChromium; | 11 using WebCore::ScrollbarLayerChromium; |
13 | 12 |
14 namespace WebKit { | 13 namespace WebKit { |
15 | 14 |
16 WebScrollbarLayer* WebScrollbarLayer::create(WebCore::Scrollbar* scrollbar, WebS
crollbarThemePainter painter, PassOwnPtr<WebScrollbarThemeGeometry> geometry) | 15 WebScrollbarLayer* WebScrollbarLayer::create(WebScrollbar* scrollbar, WebScrollb
arThemePainter painter, WebScrollbarThemeGeometry* geometry) |
17 { | 16 { |
18 return new WebScrollbarLayerImpl(ScrollbarLayerChromium::create(WebScrollbar
::create(scrollbar), painter, geometry, 0)); | 17 return new WebScrollbarLayerImpl(ScrollbarLayerChromium::create(adoptPtr(scr
ollbar), painter, adoptPtr(geometry), 0)); |
19 } | 18 } |
20 | 19 |
21 | 20 |
22 WebScrollbarLayerImpl::WebScrollbarLayerImpl(PassRefPtr<WebCore::ScrollbarLayerC
hromium> layer) | 21 WebScrollbarLayerImpl::WebScrollbarLayerImpl(PassRefPtr<WebCore::ScrollbarLayerC
hromium> layer) |
23 : m_layer(adoptPtr(new WebLayerImpl(layer))) | 22 : m_layer(adoptPtr(new WebLayerImpl(layer))) |
24 { | 23 { |
25 } | 24 } |
26 | 25 |
27 WebScrollbarLayerImpl::~WebScrollbarLayerImpl() | 26 WebScrollbarLayerImpl::~WebScrollbarLayerImpl() |
28 { | 27 { |
29 } | 28 } |
30 | 29 |
31 WebLayer* WebScrollbarLayerImpl::layer() | 30 WebLayer* WebScrollbarLayerImpl::layer() |
32 { | 31 { |
33 return m_layer.get(); | 32 return m_layer.get(); |
34 } | 33 } |
35 | 34 |
36 void WebScrollbarLayerImpl::setScrollLayer(WebLayer* layer) | 35 void WebScrollbarLayerImpl::setScrollLayer(WebLayer* layer) |
37 { | 36 { |
38 int id = layer ? static_cast<WebLayerImpl*>(layer)->layer()->id() : 0; | 37 int id = layer ? static_cast<WebLayerImpl*>(layer)->layer()->id() : 0; |
39 static_cast<ScrollbarLayerChromium*>(m_layer->layer())->setScrollLayerId(id)
; | 38 static_cast<ScrollbarLayerChromium*>(m_layer->layer())->setScrollLayerId(id)
; |
40 } | 39 } |
41 | 40 |
42 | 41 |
43 | 42 |
44 } // namespace WebKit | 43 } // namespace WebKit |
OLD | NEW |