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

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

Issue 18202006: Make scrollable viewport size no longer depend on clip layer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Apply to MaxScrollOffset Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
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 27 matching lines...) Expand all
38 int scroll_layer_id() const { return scroll_layer_id_; } 38 int scroll_layer_id() const { return scroll_layer_id_; }
39 void set_scroll_layer_id(int id) { scroll_layer_id_ = id; } 39 void set_scroll_layer_id(int id) { scroll_layer_id_ = id; }
40 40
41 ScrollbarOrientation Orientation() const; 41 ScrollbarOrientation Orientation() const;
42 float CurrentPos() const; 42 float CurrentPos() const;
43 int Maximum() const; 43 int Maximum() const;
44 44
45 void set_thumb_thickness(int thumb_thickness) { 45 void set_thumb_thickness(int thumb_thickness) {
46 thumb_thickness_ = thumb_thickness; 46 thumb_thickness_ = thumb_thickness;
47 } 47 }
48 int thumb_thickness() const { return thumb_thickness_; }
48 void set_thumb_length(int thumb_length) { 49 void set_thumb_length(int thumb_length) {
49 thumb_length_ = thumb_length; 50 thumb_length_ = thumb_length;
50 } 51 }
51 void set_track_start(int track_start) { 52 void set_track_start(int track_start) {
52 track_start_ = track_start; 53 track_start_ = track_start;
53 } 54 }
54 void set_track_length(int track_length) { 55 void set_track_length(int track_length) {
55 track_length_ = track_length; 56 track_length_ = track_length;
56 } 57 }
57 void set_vertical_adjust(float vertical_adjust) { 58 void set_vertical_adjust(float vertical_adjust) {
58 vertical_adjust_ = vertical_adjust; 59 vertical_adjust_ = vertical_adjust;
59 } 60 }
60 void set_track_resource_id(ResourceProvider::ResourceId id) { 61 void set_track_resource_id(ResourceProvider::ResourceId id) {
61 track_resource_id_ = id; 62 track_resource_id_ = id;
62 } 63 }
63 void set_thumb_resource_id(ResourceProvider::ResourceId id) { 64 void set_thumb_resource_id(ResourceProvider::ResourceId id) {
64 thumb_resource_id_ = id; 65 thumb_resource_id_ = id;
65 } 66 }
66 void set_visible_to_total_length_ratio(float ratio) { 67 void set_visible_to_total_length_ratio(float ratio) {
67 visible_to_total_length_ratio_ = ratio; 68 visible_to_total_length_ratio_ = ratio;
68 } 69 }
70 void set_is_overlay_scrollbar(bool is_overlay_scrollbar) {
71 is_overlay_scrollbar_ = is_overlay_scrollbar;
72 }
73 bool is_overlay_scrollbar() const { return is_overlay_scrollbar_; }
69 74
70 void SetCurrentPos(float current_pos) { current_pos_ = current_pos; } 75 void SetCurrentPos(float current_pos) { current_pos_ = current_pos; }
71 void SetMaximum(int maximum) { maximum_ = maximum; } 76 void SetMaximum(int maximum) { maximum_ = maximum; }
72 77
73 gfx::Rect ComputeThumbQuadRect() const; 78 gfx::Rect ComputeThumbQuadRect() const;
74 79
75 protected: 80 protected:
76 ScrollbarLayerImpl(LayerTreeImpl* tree_impl, 81 ScrollbarLayerImpl(LayerTreeImpl* tree_impl,
77 int id, 82 int id,
78 ScrollbarOrientation orientation); 83 ScrollbarOrientation orientation);
(...skipping 15 matching lines...) Expand all
94 ScrollbarOrientation orientation_; 99 ScrollbarOrientation orientation_;
95 100
96 // Difference between the clip layer's height and the visible viewport 101 // Difference between the clip layer's height and the visible viewport
97 // height (which may differ in the presence of top-controls hiding). 102 // height (which may differ in the presence of top-controls hiding).
98 float vertical_adjust_; 103 float vertical_adjust_;
99 104
100 float visible_to_total_length_ratio_; 105 float visible_to_total_length_ratio_;
101 106
102 int scroll_layer_id_; 107 int scroll_layer_id_;
103 108
104 bool is_scrollable_area_active_;
105 bool is_scroll_view_scrollbar_;
106 bool enabled_;
107 bool is_custom_scrollbar_;
108 bool is_overlay_scrollbar_; 109 bool is_overlay_scrollbar_;
109 110
110 DISALLOW_COPY_AND_ASSIGN(ScrollbarLayerImpl); 111 DISALLOW_COPY_AND_ASSIGN(ScrollbarLayerImpl);
111 }; 112 };
112 113
113 } // namespace cc 114 } // namespace cc
114 #endif // CC_LAYERS_SCROLLBAR_LAYER_IMPL_H_ 115 #endif // CC_LAYERS_SCROLLBAR_LAYER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698