OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_SCROLLBAR_LAYER_IMPL_H_ | 5 #ifndef CC_LAYERS_SCROLLBAR_LAYER_IMPL_H_ |
6 #define CC_LAYERS_SCROLLBAR_LAYER_IMPL_H_ | 6 #define CC_LAYERS_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/layer_impl.h" | 10 #include "cc/layers/layer_impl.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 virtual void AppendQuads(QuadSink* quad_sink, | 34 virtual void AppendQuads(QuadSink* quad_sink, |
35 AppendQuadsData* append_quads_data) OVERRIDE; | 35 AppendQuadsData* append_quads_data) OVERRIDE; |
36 | 36 |
37 int scroll_layer_id() const { return scroll_layer_id_; } | 37 int scroll_layer_id() const { return scroll_layer_id_; } |
38 void set_scroll_layer_id(int id) { scroll_layer_id_ = id; } | 38 void set_scroll_layer_id(int id) { scroll_layer_id_ = id; } |
39 | 39 |
40 ScrollbarOrientation Orientation() const; | 40 ScrollbarOrientation Orientation() const; |
41 float CurrentPos() const; | 41 float CurrentPos() const; |
42 int Maximum() const; | 42 int Maximum() const; |
43 | 43 |
44 void set_thumb_thickness(int thumb_thickness) { | 44 void SetThumbThickness(int thumb_thickness); |
45 thumb_thickness_ = thumb_thickness; | |
46 } | |
47 int thumb_thickness() const { return thumb_thickness_; } | 45 int thumb_thickness() const { return thumb_thickness_; } |
48 void set_thumb_length(int thumb_length) { | 46 void SetThumbLength(int thumb_length); |
49 thumb_length_ = thumb_length; | 47 void SetTrackStart(int track_start); |
50 } | 48 void SetTrackLength(int track_length); |
51 void set_track_start(int track_start) { | 49 void SetVerticalAdjust(float vertical_adjust); |
52 track_start_ = track_start; | |
53 } | |
54 void set_track_length(int track_length) { | |
55 track_length_ = track_length; | |
56 } | |
57 void set_vertical_adjust(float vertical_adjust) { | |
58 vertical_adjust_ = vertical_adjust; | |
59 } | |
60 void set_track_ui_resource_id(UIResourceId uid) { | 50 void set_track_ui_resource_id(UIResourceId uid) { |
61 track_ui_resource_id_ = uid; | 51 track_ui_resource_id_ = uid; |
62 } | 52 } |
63 void set_thumb_ui_resource_id(UIResourceId uid) { | 53 void set_thumb_ui_resource_id(UIResourceId uid) { |
64 thumb_ui_resource_id_ = uid; | 54 thumb_ui_resource_id_ = uid; |
65 } | 55 } |
66 void set_visible_to_total_length_ratio(float ratio) { | 56 void SetVisibleToTotalLengthRatio(float ratio); |
67 visible_to_total_length_ratio_ = ratio; | |
68 } | |
69 void set_is_overlay_scrollbar(bool is_overlay_scrollbar) { | 57 void set_is_overlay_scrollbar(bool is_overlay_scrollbar) { |
70 is_overlay_scrollbar_ = is_overlay_scrollbar; | 58 is_overlay_scrollbar_ = is_overlay_scrollbar; |
71 } | 59 } |
72 bool is_overlay_scrollbar() const { return is_overlay_scrollbar_; } | 60 bool is_overlay_scrollbar() const { return is_overlay_scrollbar_; } |
73 | 61 |
74 void SetCurrentPos(float current_pos) { current_pos_ = current_pos; } | 62 void SetCurrentPos(float current_pos); |
75 void SetMaximum(int maximum) { maximum_ = maximum; } | 63 void SetMaximum(int maximum); |
76 | 64 |
77 gfx::Rect ComputeThumbQuadRect() const; | 65 gfx::Rect ComputeThumbQuadRect() const; |
78 | 66 |
79 protected: | 67 protected: |
80 ScrollbarLayerImpl(LayerTreeImpl* tree_impl, | 68 ScrollbarLayerImpl(LayerTreeImpl* tree_impl, |
81 int id, | 69 int id, |
82 ScrollbarOrientation orientation); | 70 ScrollbarOrientation orientation); |
83 | 71 |
84 private: | 72 private: |
85 virtual const char* LayerTypeAsString() const OVERRIDE; | 73 virtual const char* LayerTypeAsString() const OVERRIDE; |
(...skipping 19 matching lines...) Expand all Loading... |
105 | 93 |
106 int scroll_layer_id_; | 94 int scroll_layer_id_; |
107 | 95 |
108 bool is_overlay_scrollbar_; | 96 bool is_overlay_scrollbar_; |
109 | 97 |
110 DISALLOW_COPY_AND_ASSIGN(ScrollbarLayerImpl); | 98 DISALLOW_COPY_AND_ASSIGN(ScrollbarLayerImpl); |
111 }; | 99 }; |
112 | 100 |
113 } // namespace cc | 101 } // namespace cc |
114 #endif // CC_LAYERS_SCROLLBAR_LAYER_IMPL_H_ | 102 #endif // CC_LAYERS_SCROLLBAR_LAYER_IMPL_H_ |
OLD | NEW |