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_SCROLLBAR_LAYER_IMPL_BASE_H_ | 5 #ifndef CC_LAYERS_SCROLLBAR_LAYER_IMPL_BASE_H_ |
6 #define CC_LAYERS_SCROLLBAR_LAYER_IMPL_BASE_H_ | 6 #define CC_LAYERS_SCROLLBAR_LAYER_IMPL_BASE_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.h" | 10 #include "cc/layers/layer.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; | 47 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; |
48 virtual ScrollbarLayerImplBase* ToScrollbarLayer() OVERRIDE; | 48 virtual ScrollbarLayerImplBase* ToScrollbarLayer() OVERRIDE; |
49 void PushScrollClipPropertiesTo(LayerImpl* layer); | 49 void PushScrollClipPropertiesTo(LayerImpl* layer); |
50 | 50 |
51 void SetVisibleToTotalLengthRatio(float ratio); | 51 void SetVisibleToTotalLengthRatio(float ratio); |
52 virtual gfx::Rect ComputeThumbQuadRect() const; | 52 virtual gfx::Rect ComputeThumbQuadRect() const; |
53 | 53 |
54 float thumb_thickness_scale_factor() { | 54 float thumb_thickness_scale_factor() { |
55 return thumb_thickness_scale_factor_; | 55 return thumb_thickness_scale_factor_; |
56 } | 56 } |
57 | |
58 void ResetScrollbarNeedsAnimation() { scrollbar_needs_animation_ = false; } | |
59 bool scrollbar_needs_animation() { return scrollbar_needs_animation_; } | |
60 | |
57 void SetThumbThicknessScaleFactor(float thumb_thickness_scale_factor); | 61 void SetThumbThicknessScaleFactor(float thumb_thickness_scale_factor); |
58 | 62 |
59 void ScrollbarParametersDidChange(); | 63 void ScrollbarParametersDidChange(); |
60 | 64 |
61 protected: | 65 protected: |
62 ScrollbarLayerImplBase(LayerTreeImpl* tree_impl, | 66 ScrollbarLayerImplBase(LayerTreeImpl* tree_impl, |
63 int id, | 67 int id, |
64 ScrollbarOrientation orientation, | 68 ScrollbarOrientation orientation, |
65 bool is_left_side_vertical_scrollbar, | 69 bool is_left_side_vertical_scrollbar, |
66 bool is_overlay); | 70 bool is_overlay); |
(...skipping 24 matching lines...) Expand all Loading... | |
91 int maximum_; | 95 int maximum_; |
92 ScrollbarOrientation orientation_; | 96 ScrollbarOrientation orientation_; |
93 bool is_left_side_vertical_scrollbar_; | 97 bool is_left_side_vertical_scrollbar_; |
94 | 98 |
95 // Difference between the clip layer's height and the visible viewport | 99 // Difference between the clip layer's height and the visible viewport |
96 // height (which may differ in the presence of top-controls hiding). | 100 // height (which may differ in the presence of top-controls hiding). |
97 float vertical_adjust_; | 101 float vertical_adjust_; |
98 | 102 |
99 float visible_to_total_length_ratio_; | 103 float visible_to_total_length_ratio_; |
100 | 104 |
105 bool scrollbar_needs_animation_; | |
aelias_OOO_until_Jul13
2014/09/19 23:20:17
I don't think it makes any sense to add a new bool
danakj
2014/09/19 23:25:56
That's a good idea. Wei previously pointed out the
MuVen
2014/09/20 08:42:00
Yes this is good idea.This eliminates the needs fo
MuVen
2014/09/20 08:42:00
Done.
| |
106 | |
101 DISALLOW_COPY_AND_ASSIGN(ScrollbarLayerImplBase); | 107 DISALLOW_COPY_AND_ASSIGN(ScrollbarLayerImplBase); |
102 }; | 108 }; |
103 | 109 |
104 } // namespace cc | 110 } // namespace cc |
105 | 111 |
106 #endif // CC_LAYERS_SCROLLBAR_LAYER_IMPL_BASE_H_ | 112 #endif // CC_LAYERS_SCROLLBAR_LAYER_IMPL_BASE_H_ |
OLD | NEW |