| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "cc/cc_export.h" | 9 #include "cc/cc_export.h" |
| 10 #include "cc/input/scrollbar.h" | 10 #include "cc/input/scrollbar.h" |
| 11 #include "cc/layers/layer.h" | 11 #include "cc/layers/layer.h" |
| 12 #include "cc/layers/layer_impl.h" | 12 #include "cc/layers/layer_impl.h" |
| 13 | 13 |
| 14 namespace cc { | 14 namespace cc { |
| 15 | 15 |
| 16 class LayerTreeImpl; | 16 class LayerTreeImpl; |
| 17 | 17 |
| 18 class CC_EXPORT ScrollbarLayerImplBase : public LayerImpl { | 18 class CC_EXPORT ScrollbarLayerImplBase : public LayerImpl { |
| 19 public: | 19 public: |
| 20 int ScrollLayerId() const { return scroll_layer_id_; } | |
| 21 ElementId scroll_element_id() const { return scroll_element_id_; } | 20 ElementId scroll_element_id() const { return scroll_element_id_; } |
| 22 | 21 void SetScrollElementId(ElementId scroll_element_id); |
| 23 void SetScrollInfo(int scroll_layer_id, ElementId scroll_element_id); | |
| 24 | 22 |
| 25 float current_pos() const { return current_pos_; } | 23 float current_pos() const { return current_pos_; } |
| 26 bool SetCurrentPos(float current_pos); | 24 bool SetCurrentPos(float current_pos); |
| 27 bool SetClipLayerLength(float clip_layer_length); | 25 bool SetClipLayerLength(float clip_layer_length); |
| 28 bool SetScrollLayerLength(float scroll_layer_length); | 26 bool SetScrollLayerLength(float scroll_layer_length); |
| 29 bool SetVerticalAdjust(float vertical_adjust); | 27 bool SetVerticalAdjust(float vertical_adjust); |
| 30 | 28 |
| 31 float clip_layer_length() const { return clip_layer_length_; } | 29 float clip_layer_length() const { return clip_layer_length_; } |
| 32 float scroll_layer_length() const { return scroll_layer_length_; } | 30 float scroll_layer_length() const { return scroll_layer_length_; } |
| 33 float vertical_adjust() const { return vertical_adjust_; } | 31 float vertical_adjust() const { return vertical_adjust_; } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 ~ScrollbarLayerImplBase() override; | 68 ~ScrollbarLayerImplBase() override; |
| 71 | 69 |
| 72 virtual int ThumbLength() const = 0; | 70 virtual int ThumbLength() const = 0; |
| 73 virtual float TrackLength() const = 0; | 71 virtual float TrackLength() const = 0; |
| 74 virtual int TrackStart() const = 0; | 72 virtual int TrackStart() const = 0; |
| 75 // Indicates whether the thumb length can be changed without going back to the | 73 // Indicates whether the thumb length can be changed without going back to the |
| 76 // main thread. | 74 // main thread. |
| 77 virtual bool IsThumbResizable() const = 0; | 75 virtual bool IsThumbResizable() const = 0; |
| 78 | 76 |
| 79 private: | 77 private: |
| 80 int scroll_layer_id_; | |
| 81 ElementId scroll_element_id_; | 78 ElementId scroll_element_id_; |
| 82 bool is_overlay_scrollbar_; | 79 bool is_overlay_scrollbar_; |
| 83 | 80 |
| 84 float thumb_thickness_scale_factor_; | 81 float thumb_thickness_scale_factor_; |
| 85 float current_pos_; | 82 float current_pos_; |
| 86 float clip_layer_length_; | 83 float clip_layer_length_; |
| 87 float scroll_layer_length_; | 84 float scroll_layer_length_; |
| 88 ScrollbarOrientation orientation_; | 85 ScrollbarOrientation orientation_; |
| 89 bool is_left_side_vertical_scrollbar_; | 86 bool is_left_side_vertical_scrollbar_; |
| 90 | 87 |
| 91 // Difference between the clip layer's height and the visible viewport | 88 // Difference between the clip layer's height and the visible viewport |
| 92 // height (which may differ in the presence of top-controls hiding). | 89 // height (which may differ in the presence of top-controls hiding). |
| 93 float vertical_adjust_; | 90 float vertical_adjust_; |
| 94 | 91 |
| 95 DISALLOW_COPY_AND_ASSIGN(ScrollbarLayerImplBase); | 92 DISALLOW_COPY_AND_ASSIGN(ScrollbarLayerImplBase); |
| 96 }; | 93 }; |
| 97 | 94 |
| 98 typedef std::set<ScrollbarLayerImplBase*> ScrollbarSet; | 95 typedef std::set<ScrollbarLayerImplBase*> ScrollbarSet; |
| 99 | 96 |
| 100 } // namespace cc | 97 } // namespace cc |
| 101 | 98 |
| 102 #endif // CC_LAYERS_SCROLLBAR_LAYER_IMPL_BASE_H_ | 99 #endif // CC_LAYERS_SCROLLBAR_LAYER_IMPL_BASE_H_ |
| OLD | NEW |