Chromium Code Reviews| Index: cc/layers/scrollbar_layer_impl_base.h |
| diff --git a/cc/layers/scrollbar_layer_impl_base.h b/cc/layers/scrollbar_layer_impl_base.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0a9fe88b65ad2c1e88564a9cfc71131d00155a49 |
| --- /dev/null |
| +++ b/cc/layers/scrollbar_layer_impl_base.h |
| @@ -0,0 +1,74 @@ |
| +// Copyright 2012 The Chromium Authors. All rights reserved. |
|
tfarina
2013/07/04 22:30:26
update the year in new files to 2013. applies to o
wjmaclean
2013/07/05 17:06:25
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CC_LAYERS_SCROLLBAR_LAYER_IMPL_BASE_H_ |
| +#define CC_LAYERS_SCROLLBAR_LAYER_IMPL_BASE_H_ |
| + |
| +#include "cc/base/cc_export.h" |
| +#include "cc/input/scrollbar.h" |
| +#include "cc/layers/layer.h" |
|
tfarina
2013/07/04 22:30:26
do you need this include? if you do, can't you for
wjmaclean
2013/07/05 17:06:25
It's needed for the constant Layer::INVALID_ID, bu
|
| +#include "cc/layers/layer_impl.h" |
| + |
| +namespace cc { |
| + |
| +class LayerTreeImpl; |
| + |
| +class CC_EXPORT ScrollbarLayerImplBase : public LayerImpl { |
| + public: |
| + int scroll_layer_id() const { return scroll_layer_id_; } |
| + void set_scroll_layer_id(int id) { scroll_layer_id_ = id; } |
| + |
| + float CurrentPos() const { return current_pos_; } |
|
tfarina
2013/07/04 22:30:26
unix_hacker(), applies until SetMaximum
wjmaclean
2013/07/05 17:06:25
Done.
|
| + void SetCurrentPos(float pos) { current_pos_ = pos; } |
| + int Maximum() const { return maximum_; } |
| + void SetMaximum(int maximum) { maximum_ = maximum; } |
| + |
| + void set_visible_to_total_length_ratio(float ratio) { |
| + visible_to_total_length_ratio_ = ratio; |
| + } |
| + |
| + void set_vertical_adjust(float vertical_adjust) { |
| + vertical_adjust_ = vertical_adjust; |
| + } |
| + |
| + ScrollbarOrientation Orientation() const { return orientation_; } |
|
tfarina
2013/07/04 22:30:26
unix_hacker
wjmaclean
2013/07/05 17:06:25
Done.
|
| + |
| + virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; |
| + virtual ScrollbarLayerImplBase* ToScrollbarLayerBase() OVERRIDE; |
| + |
| + virtual gfx::Rect ComputeThumbQuadRect() const = 0; |
| + |
| + protected: |
| + ScrollbarLayerImplBase(LayerTreeImpl* tree_impl, |
| + int id, |
| + ScrollbarOrientation orientation) |
| + : LayerImpl(tree_impl, id), |
| + scroll_layer_id_(Layer::INVALID_ID), |
| + current_pos_(0.f), |
| + maximum_(0), |
| + orientation_(orientation), |
| + visible_to_total_length_ratio_(1.f), |
|
tfarina
2013/07/04 22:30:26
can you do all this initialization in the source f
wjmaclean
2013/07/05 17:06:25
Done.
|
| + vertical_adjust_(0.f) {} |
| + virtual ~ScrollbarLayerImplBase() {} |
| + |
| + gfx::Rect ScrollbarLayerRectToContentRect(gfx::RectF layer_rect) const; |
| + gfx::Rect ComputeThumbQuadRectInternal(int thumb_length, |
| + float track_length, |
| + int track_start, |
| + int thumb_thickness) const; |
| + |
| + int scroll_layer_id_; |
|
tfarina
2013/07/04 22:30:26
these data member variables should be private.
Se
wjmaclean
2013/07/05 17:06:25
Done.
|
| + |
| + float current_pos_; |
| + int maximum_; |
| + ScrollbarOrientation orientation_; |
| + |
| + float visible_to_total_length_ratio_; |
| + // Difference between the clip layer's height and the visible viewport |
| + // height (which may differ in the presence of top-controls hiding). |
| + float vertical_adjust_; |
| +}; |
|
tfarina
2013/07/04 22:30:26
DISALLOW_ ....
wjmaclean
2013/07/05 17:06:25
Done.
|
| + |
| +} // namespace cc |
| +#endif // CC_LAYERS_SCROLLBAR_LAYER_IMPL_BASE_H_ |
|
tfarina
2013/07/04 22:30:26
tinynit: add blank line above.
wjmaclean
2013/07/05 17:06:25
Done.
|