Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: cc/layers/scrollbar_layer_impl_base.h

Issue 2816063003: Replace layer id with Element id for tracking scrollbar animation controllers (Closed)
Patch Set: Address reviewer comments, pull element_id.h change to another patch Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_; } 20 int ScrollLayerId() const { return scroll_layer_id_; }
21 ElementId scroll_element_id() const { return scroll_element_id_; }
21 22
22 void SetScrollLayerId(int scroll_layer_id); 23 void SetScrollInfo(int scroll_layer_id, ElementId scroll_element_id);
23 24
24 float current_pos() const { return current_pos_; } 25 float current_pos() const { return current_pos_; }
25 bool SetCurrentPos(float current_pos); 26 bool SetCurrentPos(float current_pos);
26 bool SetClipLayerLength(float clip_layer_length); 27 bool SetClipLayerLength(float clip_layer_length);
27 bool SetScrollLayerLength(float scroll_layer_length); 28 bool SetScrollLayerLength(float scroll_layer_length);
28 bool SetVerticalAdjust(float vertical_adjust); 29 bool SetVerticalAdjust(float vertical_adjust);
29 30
30 float clip_layer_length() const { return clip_layer_length_; } 31 float clip_layer_length() const { return clip_layer_length_; }
31 float scroll_layer_length() const { return scroll_layer_length_; } 32 float scroll_layer_length() const { return scroll_layer_length_; }
32 float vertical_adjust() const { return vertical_adjust_; } 33 float vertical_adjust() const { return vertical_adjust_; }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 71
71 virtual int ThumbLength() const = 0; 72 virtual int ThumbLength() const = 0;
72 virtual float TrackLength() const = 0; 73 virtual float TrackLength() const = 0;
73 virtual int TrackStart() const = 0; 74 virtual int TrackStart() const = 0;
74 // Indicates whether the thumb length can be changed without going back to the 75 // Indicates whether the thumb length can be changed without going back to the
75 // main thread. 76 // main thread.
76 virtual bool IsThumbResizable() const = 0; 77 virtual bool IsThumbResizable() const = 0;
77 78
78 private: 79 private:
79 int scroll_layer_id_; 80 int scroll_layer_id_;
81 ElementId scroll_element_id_;
80 bool is_overlay_scrollbar_; 82 bool is_overlay_scrollbar_;
81 83
82 float thumb_thickness_scale_factor_; 84 float thumb_thickness_scale_factor_;
83 float current_pos_; 85 float current_pos_;
84 float clip_layer_length_; 86 float clip_layer_length_;
85 float scroll_layer_length_; 87 float scroll_layer_length_;
86 ScrollbarOrientation orientation_; 88 ScrollbarOrientation orientation_;
87 bool is_left_side_vertical_scrollbar_; 89 bool is_left_side_vertical_scrollbar_;
88 90
89 // Difference between the clip layer's height and the visible viewport 91 // Difference between the clip layer's height and the visible viewport
90 // height (which may differ in the presence of top-controls hiding). 92 // height (which may differ in the presence of top-controls hiding).
91 float vertical_adjust_; 93 float vertical_adjust_;
92 94
93 DISALLOW_COPY_AND_ASSIGN(ScrollbarLayerImplBase); 95 DISALLOW_COPY_AND_ASSIGN(ScrollbarLayerImplBase);
94 }; 96 };
95 97
96 typedef std::set<ScrollbarLayerImplBase*> ScrollbarSet; 98 typedef std::set<ScrollbarLayerImplBase*> ScrollbarSet;
97 99
98 } // namespace cc 100 } // namespace cc
99 101
100 #endif // CC_LAYERS_SCROLLBAR_LAYER_IMPL_BASE_H_ 102 #endif // CC_LAYERS_SCROLLBAR_LAYER_IMPL_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698