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" |
11 #include "cc/layers/layer_impl.h" | 11 #include "cc/layers/layer_impl.h" |
12 | 12 |
13 namespace cc { | 13 namespace cc { |
14 | 14 |
15 class LayerTreeImpl; | 15 class LayerTreeImpl; |
16 | 16 |
17 class CC_EXPORT ScrollbarLayerImplBase : public LayerImpl { | 17 class CC_EXPORT ScrollbarLayerImplBase : public LayerImpl { |
18 public: | 18 public: |
19 int ScrollLayerId() const { | 19 int ScrollLayerId() const { |
20 return scroll_layer_ ? scroll_layer_->id() : Layer::INVALID_ID; | 20 return scroll_layer_ ? scroll_layer_->id() : Layer::INVALID_ID; |
21 } | 21 } |
22 int ClipLayerId() const { | 22 int ClipLayerId() const { |
23 return clip_layer_ ? clip_layer_->id() : Layer::INVALID_ID; | 23 return clip_layer_ ? clip_layer_->id() : Layer::INVALID_ID; |
24 } | 24 } |
25 | 25 |
26 void SetScrollLayerAndClipLayerByIds(int scroll_layer_id, int clip_layer_id); | 26 void SetScrollLayerAndClipLayerByIds(int scroll_layer_id, int clip_layer_id); |
27 void ClearScrollLayer() { scroll_layer_ = NULL; } | 27 void ClearScrollLayer() { scroll_layer_ = nullptr; } |
28 void ClearClipLayer() { clip_layer_ = NULL; } | 28 void ClearClipLayer() { clip_layer_ = nullptr; } |
29 | 29 |
30 float current_pos() const { return current_pos_; } | 30 float current_pos() const { return current_pos_; } |
31 bool SetCurrentPos(float current_pos); | 31 bool SetCurrentPos(float current_pos); |
32 int maximum() const { return maximum_; } | 32 int maximum() const { return maximum_; } |
33 bool SetMaximum(int maximum); | 33 bool SetMaximum(int maximum); |
34 | 34 |
35 bool SetVerticalAdjust(float vertical_adjust); | 35 bool SetVerticalAdjust(float vertical_adjust); |
36 | 36 |
37 bool is_overlay_scrollbar() const { return is_overlay_scrollbar_; } | 37 bool is_overlay_scrollbar() const { return is_overlay_scrollbar_; } |
38 void set_is_overlay_scrollbar(bool is_overlay) { | 38 void set_is_overlay_scrollbar(bool is_overlay) { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 float vertical_adjust_; | 97 float vertical_adjust_; |
98 | 98 |
99 float visible_to_total_length_ratio_; | 99 float visible_to_total_length_ratio_; |
100 | 100 |
101 DISALLOW_COPY_AND_ASSIGN(ScrollbarLayerImplBase); | 101 DISALLOW_COPY_AND_ASSIGN(ScrollbarLayerImplBase); |
102 }; | 102 }; |
103 | 103 |
104 } // namespace cc | 104 } // namespace cc |
105 | 105 |
106 #endif // CC_LAYERS_SCROLLBAR_LAYER_IMPL_BASE_H_ | 106 #endif // CC_LAYERS_SCROLLBAR_LAYER_IMPL_BASE_H_ |
OLD | NEW |