| 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..c0d153b0bd4c120e994dead17f7882afc2e6b88c
|
| --- /dev/null
|
| +++ b/cc/layers/scrollbar_layer_impl_base.h
|
| @@ -0,0 +1,81 @@
|
| +// Copyright 2013 The Chromium Authors. All rights reserved.
|
| +// 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_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 current_pos() const { return current_pos_; }
|
| + void set_current_pos(float pos) { current_pos_ = pos; }
|
| + int maximum() const { return maximum_; }
|
| + void set_maximum(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;
|
| + }
|
| +
|
| + void set_is_overlay_scrollbar(bool is_overlay) {
|
| + is_overlay_scrollbar_ = is_overlay;
|
| + }
|
| +
|
| + ScrollbarOrientation orientation() const { return orientation_; }
|
| +
|
| + virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
|
| + virtual ScrollbarLayerImplBase* ToScrollbarLayer() OVERRIDE;
|
| +
|
| + virtual gfx::Rect ComputeThumbQuadRect() const;
|
| +
|
| + protected:
|
| + ScrollbarLayerImplBase(LayerTreeImpl* tree_impl,
|
| + int id,
|
| + ScrollbarOrientation orientation);
|
| + virtual ~ScrollbarLayerImplBase() {}
|
| +
|
| + gfx::Rect ScrollbarLayerRectToContentRect(gfx::RectF layer_rect) const;
|
| +
|
| + float visible_to_total_length_ratio() const {
|
| + return visible_to_total_length_ratio_;
|
| + }
|
| + float vertical_adjust() const { return vertical_adjust_; }
|
| +
|
| + virtual int ThumbThickness() const = 0;
|
| + virtual int ThumbLength() const = 0;
|
| + virtual float TrackLength() const = 0;
|
| + virtual int TrackStart() const = 0;
|
| +
|
| + private:
|
| + int scroll_layer_id_;
|
| + bool is_overlay_scrollbar_;
|
| +
|
| + 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_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(ScrollbarLayerImplBase);
|
| +};
|
| +
|
| +} // namespace cc
|
| +
|
| +#endif // CC_LAYERS_SCROLLBAR_LAYER_IMPL_BASE_H_
|
|
|