Remove deprecated extension notification from AppWindow
[chromium-blink-merge.git] / cc / layers / solid_color_scrollbar_layer.cc
blob7ea726599574d2545007415ba810bf85833ad713
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 const bool kIsOverlayScrollbar = true;
16 return SolidColorScrollbarLayerImpl::Create(tree_impl,
17 id(),
18 orientation(),
19 thumb_thickness_,
20 track_start_,
21 is_left_side_vertical_scrollbar_,
22 kIsOverlayScrollbar)
23 .PassAs<LayerImpl>();
26 scoped_refptr<SolidColorScrollbarLayer> SolidColorScrollbarLayer::Create(
27 ScrollbarOrientation orientation,
28 int thumb_thickness,
29 int track_start,
30 bool is_left_side_vertical_scrollbar,
31 int scroll_layer_id) {
32 return make_scoped_refptr(
33 new SolidColorScrollbarLayer(orientation,
34 thumb_thickness,
35 track_start,
36 is_left_side_vertical_scrollbar,
37 scroll_layer_id));
40 SolidColorScrollbarLayer::SolidColorScrollbarLayer(
41 ScrollbarOrientation orientation,
42 int thumb_thickness,
43 int track_start,
44 bool is_left_side_vertical_scrollbar,
45 int scroll_layer_id)
46 : scroll_layer_id_(Layer::INVALID_ID),
47 clip_layer_id_(scroll_layer_id),
48 orientation_(orientation),
49 thumb_thickness_(thumb_thickness),
50 track_start_(track_start),
51 is_left_side_vertical_scrollbar_(is_left_side_vertical_scrollbar) {}
53 SolidColorScrollbarLayer::~SolidColorScrollbarLayer() {}
55 ScrollbarLayerInterface* SolidColorScrollbarLayer::ToScrollbarLayer() {
56 return this;
59 void SolidColorScrollbarLayer::PushPropertiesTo(LayerImpl* layer) {
60 Layer::PushPropertiesTo(layer);
61 PushScrollClipPropertiesTo(layer);
64 void SolidColorScrollbarLayer::PushScrollClipPropertiesTo(LayerImpl* layer) {
65 SolidColorScrollbarLayerImpl* scrollbar_layer =
66 static_cast<SolidColorScrollbarLayerImpl*>(layer);
68 scrollbar_layer->SetScrollLayerAndClipLayerByIds(scroll_layer_id_,
69 clip_layer_id_);
72 void SolidColorScrollbarLayer::SetNeedsDisplayRect(const gfx::RectF&) {
73 // Never needs repaint.
76 bool SolidColorScrollbarLayer::OpacityCanAnimateOnImplThread() const {
77 return true;
80 int SolidColorScrollbarLayer::ScrollLayerId() const {
81 return scroll_layer_id_;
84 void SolidColorScrollbarLayer::SetScrollLayer(int layer_id) {
85 if (layer_id == scroll_layer_id_)
86 return;
88 scroll_layer_id_ = layer_id;
89 SetNeedsFullTreeSync();
92 void SolidColorScrollbarLayer::SetClipLayer(int layer_id) {
93 if (layer_id == clip_layer_id_)
94 return;
96 clip_layer_id_ = layer_id;
97 SetNeedsFullTreeSync();
100 ScrollbarOrientation SolidColorScrollbarLayer::orientation() const {
101 return orientation_;
104 } // namespace cc