Roll src/buildtools ea47835:451dcd0
[chromium-blink-merge.git] / cc / test / fake_painted_scrollbar_layer.h
blobe86a2e908d5fd498b8065bb6f865bc0d55de18c3
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_TEST_FAKE_PAINTED_SCROLLBAR_LAYER_H_
6 #define CC_TEST_FAKE_PAINTED_SCROLLBAR_LAYER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "cc/layers/painted_scrollbar_layer.h"
10 #include "cc/test/fake_scrollbar.h"
12 namespace base { template<typename T> class AutoReset; }
14 namespace cc {
16 class FakePaintedScrollbarLayer : public PaintedScrollbarLayer {
17 public:
18 static scoped_refptr<FakePaintedScrollbarLayer>
19 Create(bool paint_during_update, bool has_thumb, int scrolling_layer_id);
20 int update_count() const { return update_count_; }
21 void reset_update_count() { update_count_ = 0; }
23 bool Update(ResourceUpdateQueue* queue,
24 const OcclusionTracker<Layer>* occlusion) override;
26 void PushPropertiesTo(LayerImpl* layer) override;
28 scoped_ptr<base::AutoReset<bool>> IgnoreSetNeedsCommit();
30 size_t push_properties_count() const { return push_properties_count_; }
31 void reset_push_properties_count() { push_properties_count_ = 0; }
33 // For unit tests
34 UIResourceId track_resource_id() {
35 return PaintedScrollbarLayer::track_resource_id();
37 UIResourceId thumb_resource_id() {
38 return PaintedScrollbarLayer::thumb_resource_id();
40 FakeScrollbar* fake_scrollbar() {
41 return fake_scrollbar_;
43 using PaintedScrollbarLayer::UpdateThumbAndTrackGeometry;
45 private:
46 FakePaintedScrollbarLayer(FakeScrollbar* fake_scrollbar,
47 int scrolling_layer_id);
48 ~FakePaintedScrollbarLayer() override;
50 int update_count_;
51 size_t push_properties_count_;
52 FakeScrollbar* fake_scrollbar_;
55 } // namespace cc
57 #endif // CC_TEST_FAKE_PAINTED_SCROLLBAR_LAYER_H_