Abstract GoogleURLTracker & google_util Profile dependencies
[chromium-blink-merge.git] / cc / layers / painted_scrollbar_layer_impl.h
blob16cfa55680ccae4756e866a5d390763d7ab8b6d0
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
3 // found in the LICENSE file.
5 #ifndef CC_LAYERS_PAINTED_SCROLLBAR_LAYER_IMPL_H_
6 #define CC_LAYERS_PAINTED_SCROLLBAR_LAYER_IMPL_H_
8 #include "cc/base/cc_export.h"
9 #include "cc/input/scrollbar.h"
10 #include "cc/layers/scrollbar_layer_impl_base.h"
11 #include "cc/resources/ui_resource_client.h"
13 namespace cc {
15 class LayerTreeImpl;
16 class ScrollView;
18 class CC_EXPORT PaintedScrollbarLayerImpl : public ScrollbarLayerImplBase {
19 public:
20 static scoped_ptr<PaintedScrollbarLayerImpl> Create(
21 LayerTreeImpl* tree_impl,
22 int id,
23 ScrollbarOrientation orientation);
24 virtual ~PaintedScrollbarLayerImpl();
26 // LayerImpl implementation.
27 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
28 OVERRIDE;
29 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
31 virtual bool WillDraw(DrawMode draw_mode,
32 ResourceProvider* resource_provider) OVERRIDE;
33 virtual void AppendQuads(QuadSink* quad_sink,
34 AppendQuadsData* append_quads_data) OVERRIDE;
36 void SetThumbThickness(int thumb_thickness);
37 void SetThumbLength(int thumb_length);
38 void SetTrackStart(int track_start);
39 void SetTrackLength(int track_length);
41 void set_track_ui_resource_id(UIResourceId uid) {
42 track_ui_resource_id_ = uid;
44 void set_thumb_ui_resource_id(UIResourceId uid) {
45 thumb_ui_resource_id_ = uid;
48 protected:
49 PaintedScrollbarLayerImpl(LayerTreeImpl* tree_impl,
50 int id,
51 ScrollbarOrientation orientation);
53 // ScrollbarLayerImplBase implementation.
54 virtual int ThumbThickness() const OVERRIDE;
55 virtual int ThumbLength() const OVERRIDE;
56 virtual float TrackLength() const OVERRIDE;
57 virtual int TrackStart() const OVERRIDE;
58 virtual bool IsThumbResizable() const OVERRIDE;
60 private:
61 virtual const char* LayerTypeAsString() const OVERRIDE;
63 UIResourceId track_ui_resource_id_;
64 UIResourceId thumb_ui_resource_id_;
66 int thumb_thickness_;
67 int thumb_length_;
68 int track_start_;
69 int track_length_;
71 // Difference between the clip layer's height and the visible viewport
72 // height (which may differ in the presence of top-controls hiding).
73 float vertical_adjust_;
75 int scroll_layer_id_;
77 DISALLOW_COPY_AND_ASSIGN(PaintedScrollbarLayerImpl);
80 } // namespace cc
81 #endif // CC_LAYERS_PAINTED_SCROLLBAR_LAYER_IMPL_H_