| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CC_LAYERS_SOLID_COLOR_SCROLLBAR_LAYER_H_ | 5 #ifndef CC_LAYERS_SOLID_COLOR_SCROLLBAR_LAYER_H_ |
| 6 #define CC_LAYERS_SOLID_COLOR_SCROLLBAR_LAYER_H_ | 6 #define CC_LAYERS_SOLID_COLOR_SCROLLBAR_LAYER_H_ |
| 7 | 7 |
| 8 #include "cc/base/cc_export.h" | 8 #include "cc/base/cc_export.h" |
| 9 #include "cc/layers/layer.h" | 9 #include "cc/layers/layer.h" |
| 10 #include "cc/layers/scrollbar_layer_interface.h" | 10 #include "cc/layers/scrollbar_layer_interface.h" |
| 11 | 11 |
| 12 namespace cc { | 12 namespace cc { |
| 13 | 13 |
| 14 class CC_EXPORT SolidColorScrollbarLayer : public ScrollbarLayerInterface, | 14 class CC_EXPORT SolidColorScrollbarLayer : public ScrollbarLayerInterface, |
| 15 public Layer { | 15 public Layer { |
| 16 public: | 16 public: |
| 17 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) | 17 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) |
| 18 OVERRIDE; | 18 OVERRIDE; |
| 19 | 19 |
| 20 static scoped_refptr<SolidColorScrollbarLayer> Create( | 20 static scoped_refptr<SolidColorScrollbarLayer> Create( |
| 21 ScrollbarOrientation orientation, | 21 ScrollbarOrientation orientation, |
| 22 int thumb_thickness, | 22 int thumb_thickness, |
| 23 int track_start, |
| 23 bool is_left_side_vertical_scrollbar, | 24 bool is_left_side_vertical_scrollbar, |
| 24 int scroll_layer_id); | 25 int scroll_layer_id); |
| 25 | 26 |
| 26 // Layer overrides. | 27 // Layer overrides. |
| 27 virtual bool OpacityCanAnimateOnImplThread() const OVERRIDE; | 28 virtual bool OpacityCanAnimateOnImplThread() const OVERRIDE; |
| 28 virtual ScrollbarLayerInterface* ToScrollbarLayer() OVERRIDE; | 29 virtual ScrollbarLayerInterface* ToScrollbarLayer() OVERRIDE; |
| 29 | 30 |
| 30 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; | 31 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; |
| 31 virtual void PushScrollClipPropertiesTo(LayerImpl* layer) OVERRIDE; | 32 virtual void PushScrollClipPropertiesTo(LayerImpl* layer) OVERRIDE; |
| 32 | 33 |
| 33 virtual void SetNeedsDisplayRect(const gfx::RectF&) OVERRIDE; | 34 virtual void SetNeedsDisplayRect(const gfx::RectF&) OVERRIDE; |
| 34 | 35 |
| 35 // ScrollbarLayerInterface | 36 // ScrollbarLayerInterface |
| 36 virtual int ScrollLayerId() const OVERRIDE; | 37 virtual int ScrollLayerId() const OVERRIDE; |
| 37 virtual void SetScrollLayer(int layer_id) OVERRIDE; | 38 virtual void SetScrollLayer(int layer_id) OVERRIDE; |
| 38 virtual void SetClipLayer(int layer_id) OVERRIDE; | 39 virtual void SetClipLayer(int layer_id) OVERRIDE; |
| 39 | 40 |
| 40 virtual ScrollbarOrientation orientation() const OVERRIDE; | 41 virtual ScrollbarOrientation orientation() const OVERRIDE; |
| 41 | 42 |
| 42 protected: | 43 protected: |
| 43 SolidColorScrollbarLayer(ScrollbarOrientation orientation, | 44 SolidColorScrollbarLayer(ScrollbarOrientation orientation, |
| 44 int thumb_thickness, | 45 int thumb_thickness, |
| 46 int track_start, |
| 45 bool is_left_side_vertical_scrollbar, | 47 bool is_left_side_vertical_scrollbar, |
| 46 int scroll_layer_id); | 48 int scroll_layer_id); |
| 47 virtual ~SolidColorScrollbarLayer(); | 49 virtual ~SolidColorScrollbarLayer(); |
| 48 | 50 |
| 49 private: | 51 private: |
| 50 int scroll_layer_id_; | 52 int scroll_layer_id_; |
| 51 int clip_layer_id_; | 53 int clip_layer_id_; |
| 52 ScrollbarOrientation orientation_; | 54 ScrollbarOrientation orientation_; |
| 53 int thumb_thickness_; | 55 int thumb_thickness_; |
| 56 int track_start_; |
| 54 bool is_left_side_vertical_scrollbar_; | 57 bool is_left_side_vertical_scrollbar_; |
| 55 | 58 |
| 56 DISALLOW_COPY_AND_ASSIGN(SolidColorScrollbarLayer); | 59 DISALLOW_COPY_AND_ASSIGN(SolidColorScrollbarLayer); |
| 57 }; | 60 }; |
| 58 | 61 |
| 59 } // namespace cc | 62 } // namespace cc |
| 60 | 63 |
| 61 #endif // CC_LAYERS_SOLID_COLOR_SCROLLBAR_LAYER_H_ | 64 #endif // CC_LAYERS_SOLID_COLOR_SCROLLBAR_LAYER_H_ |
| OLD | NEW |