Adding a logging class to cast.
[chromium-blink-merge.git] / cc / layers / solid_color_scrollbar_layer.cc
blobd9ed922e5d893e9744d23ad38ca2d98f0a91126e
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "cc/layers/solid_color_scrollbar_layer.h"
7 #include "base/memory/scoped_ptr.h"
8 #include "cc/layers/layer_impl.h"
9 #include "cc/layers/solid_color_scrollbar_layer_impl.h"
11 namespace cc {
13 scoped_ptr<LayerImpl> SolidColorScrollbarLayer::CreateLayerImpl(
14 LayerTreeImpl* tree_impl) {
15 return SolidColorScrollbarLayerImpl::Create(
16 tree_impl, id(), orientation(), thumb_thickness_,
17 is_left_side_vertical_scrollbar_).PassAs<LayerImpl>();
20 scoped_refptr<SolidColorScrollbarLayer> SolidColorScrollbarLayer::Create(
21 ScrollbarOrientation orientation,
22 int thumb_thickness,
23 bool is_left_side_vertical_scrollbar,
24 int scroll_layer_id) {
25 return make_scoped_refptr(new SolidColorScrollbarLayer(
26 orientation,
27 thumb_thickness,
28 is_left_side_vertical_scrollbar,
29 scroll_layer_id));
32 SolidColorScrollbarLayer::SolidColorScrollbarLayer(
33 ScrollbarOrientation orientation,
34 int thumb_thickness,
35 bool is_left_side_vertical_scrollbar,
36 int scroll_layer_id)
37 : scroll_layer_id_(scroll_layer_id),
38 orientation_(orientation),
39 thumb_thickness_(thumb_thickness),
40 is_left_side_vertical_scrollbar_(is_left_side_vertical_scrollbar) {}
42 SolidColorScrollbarLayer::~SolidColorScrollbarLayer() {}
44 ScrollbarLayerInterface* SolidColorScrollbarLayer::ToScrollbarLayer() {
45 return this;
48 bool SolidColorScrollbarLayer::OpacityCanAnimateOnImplThread() const {
49 return true;
52 int SolidColorScrollbarLayer::ScrollLayerId() const {
53 return scroll_layer_id_;
56 void SolidColorScrollbarLayer::SetScrollLayerId(int id) {
57 if (id == scroll_layer_id_)
58 return;
60 scroll_layer_id_ = id;
61 SetNeedsFullTreeSync();
64 ScrollbarOrientation SolidColorScrollbarLayer::orientation() const {
65 return orientation_;
68 } // namespace cc