| 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" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 void SetTrackStart(int track_start); | 38 void SetTrackStart(int track_start); |
| 39 void SetTrackLength(int track_length); | 39 void SetTrackLength(int track_length); |
| 40 | 40 |
| 41 void set_track_ui_resource_id(UIResourceId uid) { | 41 void set_track_ui_resource_id(UIResourceId uid) { |
| 42 track_ui_resource_id_ = uid; | 42 track_ui_resource_id_ = uid; |
| 43 } | 43 } |
| 44 void set_thumb_ui_resource_id(UIResourceId uid) { | 44 void set_thumb_ui_resource_id(UIResourceId uid) { |
| 45 thumb_ui_resource_id_ = uid; | 45 thumb_ui_resource_id_ = uid; |
| 46 } | 46 } |
| 47 | 47 |
| 48 void set_track_opacity(float opacity) { track_opacity_ = opacity; } |
| 49 void set_thumb_opacity(float opacity) { thumb_opacity_ = opacity; } |
| 50 |
| 48 void set_internal_contents_scale_and_bounds(float content_scale, | 51 void set_internal_contents_scale_and_bounds(float content_scale, |
| 49 const gfx::Size& content_bounds) { | 52 const gfx::Size& content_bounds) { |
| 50 internal_contents_scale_ = content_scale; | 53 internal_contents_scale_ = content_scale; |
| 51 internal_content_bounds_ = content_bounds; | 54 internal_content_bounds_ = content_bounds; |
| 52 } | 55 } |
| 53 | 56 |
| 54 protected: | 57 protected: |
| 55 PaintedScrollbarLayerImpl(LayerTreeImpl* tree_impl, | 58 PaintedScrollbarLayerImpl(LayerTreeImpl* tree_impl, |
| 56 int id, | 59 int id, |
| 57 ScrollbarOrientation orientation); | 60 ScrollbarOrientation orientation); |
| 58 | 61 |
| 59 // ScrollbarLayerImplBase implementation. | 62 // ScrollbarLayerImplBase implementation. |
| 60 int ThumbThickness() const override; | 63 int ThumbThickness() const override; |
| 61 int ThumbLength() const override; | 64 int ThumbLength() const override; |
| 62 float TrackLength() const override; | 65 float TrackLength() const override; |
| 63 int TrackStart() const override; | 66 int TrackStart() const override; |
| 64 bool IsThumbResizable() const override; | 67 bool IsThumbResizable() const override; |
| 65 | 68 |
| 66 private: | 69 private: |
| 67 const char* LayerTypeAsString() const override; | 70 const char* LayerTypeAsString() const override; |
| 68 | 71 |
| 69 UIResourceId track_ui_resource_id_; | 72 UIResourceId track_ui_resource_id_; |
| 70 UIResourceId thumb_ui_resource_id_; | 73 UIResourceId thumb_ui_resource_id_; |
| 71 | 74 |
| 75 float track_opacity_; |
| 76 float thumb_opacity_; |
| 77 |
| 72 float internal_contents_scale_; | 78 float internal_contents_scale_; |
| 73 gfx::Size internal_content_bounds_; | 79 gfx::Size internal_content_bounds_; |
| 74 | 80 |
| 75 int thumb_thickness_; | 81 int thumb_thickness_; |
| 76 int thumb_length_; | 82 int thumb_length_; |
| 77 int track_start_; | 83 int track_start_; |
| 78 int track_length_; | 84 int track_length_; |
| 79 | 85 |
| 80 DISALLOW_COPY_AND_ASSIGN(PaintedScrollbarLayerImpl); | 86 DISALLOW_COPY_AND_ASSIGN(PaintedScrollbarLayerImpl); |
| 81 }; | 87 }; |
| 82 | 88 |
| 83 } // namespace cc | 89 } // namespace cc |
| 84 #endif // CC_LAYERS_PAINTED_SCROLLBAR_LAYER_IMPL_H_ | 90 #endif // CC_LAYERS_PAINTED_SCROLLBAR_LAYER_IMPL_H_ |
| OLD | NEW |