| Index: cc/layers/solid_color_scrollbar_layer.cc
|
| diff --git a/cc/layers/solid_color_scrollbar_layer.cc b/cc/layers/solid_color_scrollbar_layer.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..5caaef2f53d55da841ab3a12219a5c13c73a454e
|
| --- /dev/null
|
| +++ b/cc/layers/solid_color_scrollbar_layer.cc
|
| @@ -0,0 +1,58 @@
|
| +// Copyright 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "cc/layers/solid_color_scrollbar_layer.h"
|
| +
|
| +#include "base/memory/scoped_ptr.h"
|
| +#include "cc/layers/layer_impl.h"
|
| +#include "cc/layers/solid_color_scrollbar_layer_impl.h"
|
| +
|
| +namespace cc {
|
| +
|
| +scoped_ptr<LayerImpl> SolidColorScrollbarLayer::CreateLayerImpl(
|
| + LayerTreeImpl* tree_impl) {
|
| + return SolidColorScrollbarLayerImpl::Create(
|
| + tree_impl, id(), orientation_, thumb_thickness_, color_)
|
| + .PassAs<LayerImpl>();
|
| +}
|
| +
|
| +scoped_refptr<SolidColorScrollbarLayer> SolidColorScrollbarLayer::Create(
|
| + ScrollbarOrientation orientation,
|
| + int thumb_thickness,
|
| + SkColor color,
|
| + int scroll_layer_id) {
|
| + return make_scoped_refptr(new SolidColorScrollbarLayer(orientation,
|
| + thumb_thickness,
|
| + color,
|
| + scroll_layer_id));
|
| +}
|
| +
|
| +SolidColorScrollbarLayer::SolidColorScrollbarLayer(
|
| + ScrollbarOrientation orientation,
|
| + int thumb_thickness,
|
| + SkColor color,
|
| + int scroll_layer_id)
|
| + : ScrollbarLayerBase(scroll_layer_id, orientation),
|
| + thumb_thickness_(thumb_thickness),
|
| + color_(color) {}
|
| +
|
| +SolidColorScrollbarLayer::~SolidColorScrollbarLayer() {}
|
| +
|
| +ScrollbarLayerBase* SolidColorScrollbarLayer::ToScrollbarLayerBase() {
|
| + return this;
|
| +}
|
| +
|
| +bool SolidColorScrollbarLayer::OpacityCanAnimateOnImplThread() const {
|
| + return true;
|
| +}
|
| +
|
| +void SolidColorScrollbarLayer::SetScrollLayerId(int id) {
|
| + if (id == scroll_layer_id_)
|
| + return;
|
| +
|
| + scroll_layer_id_ = id;
|
| + SetNeedsFullTreeSync();
|
| +}
|
| +
|
| +} // namespace cc
|
|
|