Add ICU message format support
[chromium-blink-merge.git] / cc / test / fake_painted_scrollbar_layer.h
blob72ea250d4405e4b80b3f991775a53183ff46bc8f
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> Create(
19 const LayerSettings& settings,
20 bool paint_during_update,
21 bool has_thumb,
22 int scrolling_layer_id);
23 int update_count() const { return update_count_; }
24 void reset_update_count() { update_count_ = 0; }
26 bool Update() override;
28 void PushPropertiesTo(LayerImpl* layer) override;
30 scoped_ptr<base::AutoReset<bool>> IgnoreSetNeedsCommit();
32 size_t push_properties_count() const { return push_properties_count_; }
33 void reset_push_properties_count() { push_properties_count_ = 0; }
35 // For unit tests
36 UIResourceId track_resource_id() {
37 return PaintedScrollbarLayer::track_resource_id();
39 UIResourceId thumb_resource_id() {
40 return PaintedScrollbarLayer::thumb_resource_id();
42 FakeScrollbar* fake_scrollbar() {
43 return fake_scrollbar_;
45 using PaintedScrollbarLayer::UpdateInternalContentScale;
46 using PaintedScrollbarLayer::UpdateThumbAndTrackGeometry;
48 private:
49 FakePaintedScrollbarLayer(const LayerSettings& settings,
50 FakeScrollbar* fake_scrollbar,
51 int scrolling_layer_id);
52 ~FakePaintedScrollbarLayer() override;
54 int update_count_;
55 size_t push_properties_count_;
56 FakeScrollbar* fake_scrollbar_;
59 } // namespace cc
61 #endif // CC_TEST_FAKE_PAINTED_SCROLLBAR_LAYER_H_