| 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_PAINTED_SCROLLBAR_LAYER_IMPL_H_ | 5 #ifndef CC_LAYERS_PAINTED_SCROLLBAR_LAYER_IMPL_H_ |
| 6 #define CC_LAYERS_PAINTED_SCROLLBAR_LAYER_IMPL_H_ | 6 #define CC_LAYERS_PAINTED_SCROLLBAR_LAYER_IMPL_H_ |
| 7 | 7 |
| 8 #include "cc/base/cc_export.h" | 8 #include "cc/base/cc_export.h" |
| 9 #include "cc/input/scrollbar.h" | 9 #include "cc/input/scrollbar.h" |
| 10 #include "cc/layers/scrollbar_layer_impl_base.h" | 10 #include "cc/layers/scrollbar_layer_impl_base.h" |
| 11 #include "cc/resources/ui_resource_client.h" | 11 #include "cc/resources/ui_resource_client.h" |
| 12 | 12 |
| 13 namespace cc { | 13 namespace cc { |
| 14 | 14 |
| 15 class LayerTreeImpl; | 15 class LayerTreeImpl; |
| 16 class ScrollView; | 16 class ScrollView; |
| 17 | 17 |
| 18 class CC_EXPORT PaintedScrollbarLayerImpl : public ScrollbarLayerImplBase { | 18 class CC_EXPORT PaintedScrollbarLayerImpl : public ScrollbarLayerImplBase { |
| 19 public: | 19 public: |
| 20 static scoped_ptr<PaintedScrollbarLayerImpl> Create( | 20 static scoped_ptr<PaintedScrollbarLayerImpl> Create( |
| 21 LayerTreeImpl* tree_impl, | 21 LayerTreeImpl* tree_impl, |
| 22 int id, | 22 int id, |
| 23 ScrollbarOrientation orientation); | 23 ScrollbarOrientation orientation); |
| 24 virtual ~PaintedScrollbarLayerImpl(); | 24 ~PaintedScrollbarLayerImpl() override; |
| 25 | 25 |
| 26 // LayerImpl implementation. | 26 // LayerImpl implementation. |
| 27 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) | 27 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
| 28 override; | 28 void PushPropertiesTo(LayerImpl* layer) override; |
| 29 virtual void PushPropertiesTo(LayerImpl* layer) override; | |
| 30 | 29 |
| 31 virtual bool WillDraw(DrawMode draw_mode, | 30 bool WillDraw(DrawMode draw_mode, |
| 32 ResourceProvider* resource_provider) override; | 31 ResourceProvider* resource_provider) override; |
| 33 virtual void AppendQuads(RenderPass* render_pass, | 32 void AppendQuads(RenderPass* render_pass, |
| 34 const Occlusion& occlusion_in_content_space, | 33 const Occlusion& occlusion_in_content_space, |
| 35 AppendQuadsData* append_quads_data) override; | 34 AppendQuadsData* append_quads_data) override; |
| 36 | 35 |
| 37 void SetThumbThickness(int thumb_thickness); | 36 void SetThumbThickness(int thumb_thickness); |
| 38 void SetThumbLength(int thumb_length); | 37 void SetThumbLength(int thumb_length); |
| 39 void SetTrackStart(int track_start); | 38 void SetTrackStart(int track_start); |
| 40 void SetTrackLength(int track_length); | 39 void SetTrackLength(int track_length); |
| 41 | 40 |
| 42 void set_track_ui_resource_id(UIResourceId uid) { | 41 void set_track_ui_resource_id(UIResourceId uid) { |
| 43 track_ui_resource_id_ = uid; | 42 track_ui_resource_id_ = uid; |
| 44 } | 43 } |
| 45 void set_thumb_ui_resource_id(UIResourceId uid) { | 44 void set_thumb_ui_resource_id(UIResourceId uid) { |
| 46 thumb_ui_resource_id_ = uid; | 45 thumb_ui_resource_id_ = uid; |
| 47 } | 46 } |
| 48 | 47 |
| 49 protected: | 48 protected: |
| 50 PaintedScrollbarLayerImpl(LayerTreeImpl* tree_impl, | 49 PaintedScrollbarLayerImpl(LayerTreeImpl* tree_impl, |
| 51 int id, | 50 int id, |
| 52 ScrollbarOrientation orientation); | 51 ScrollbarOrientation orientation); |
| 53 | 52 |
| 54 // ScrollbarLayerImplBase implementation. | 53 // ScrollbarLayerImplBase implementation. |
| 55 virtual int ThumbThickness() const override; | 54 int ThumbThickness() const override; |
| 56 virtual int ThumbLength() const override; | 55 int ThumbLength() const override; |
| 57 virtual float TrackLength() const override; | 56 float TrackLength() const override; |
| 58 virtual int TrackStart() const override; | 57 int TrackStart() const override; |
| 59 virtual bool IsThumbResizable() const override; | 58 bool IsThumbResizable() const override; |
| 60 | 59 |
| 61 private: | 60 private: |
| 62 virtual const char* LayerTypeAsString() const override; | 61 const char* LayerTypeAsString() const override; |
| 63 | 62 |
| 64 UIResourceId track_ui_resource_id_; | 63 UIResourceId track_ui_resource_id_; |
| 65 UIResourceId thumb_ui_resource_id_; | 64 UIResourceId thumb_ui_resource_id_; |
| 66 | 65 |
| 67 int thumb_thickness_; | 66 int thumb_thickness_; |
| 68 int thumb_length_; | 67 int thumb_length_; |
| 69 int track_start_; | 68 int track_start_; |
| 70 int track_length_; | 69 int track_length_; |
| 71 | 70 |
| 72 // Difference between the clip layer's height and the visible viewport | 71 // Difference between the clip layer's height and the visible viewport |
| 73 // height (which may differ in the presence of top-controls hiding). | 72 // height (which may differ in the presence of top-controls hiding). |
| 74 float vertical_adjust_; | 73 float vertical_adjust_; |
| 75 | 74 |
| 76 int scroll_layer_id_; | 75 int scroll_layer_id_; |
| 77 | 76 |
| 78 DISALLOW_COPY_AND_ASSIGN(PaintedScrollbarLayerImpl); | 77 DISALLOW_COPY_AND_ASSIGN(PaintedScrollbarLayerImpl); |
| 79 }; | 78 }; |
| 80 | 79 |
| 81 } // namespace cc | 80 } // namespace cc |
| 82 #endif // CC_LAYERS_PAINTED_SCROLLBAR_LAYER_IMPL_H_ | 81 #endif // CC_LAYERS_PAINTED_SCROLLBAR_LAYER_IMPL_H_ |
| OLD | NEW |