OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CC_TEST_FAKE_PAINTED_SCROLLBAR_LAYER_H_ | 5 #ifndef CC_TEST_FAKE_PAINTED_SCROLLBAR_LAYER_H_ |
6 #define CC_TEST_FAKE_PAINTED_SCROLLBAR_LAYER_H_ | 6 #define CC_TEST_FAKE_PAINTED_SCROLLBAR_LAYER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include <memory> |
| 11 |
11 #include "cc/layers/painted_scrollbar_layer.h" | 12 #include "cc/layers/painted_scrollbar_layer.h" |
12 #include "cc/test/fake_scrollbar.h" | 13 #include "cc/test/fake_scrollbar.h" |
13 | 14 |
14 namespace base { template<typename T> class AutoReset; } | 15 namespace base { template<typename T> class AutoReset; } |
15 | 16 |
16 namespace cc { | 17 namespace cc { |
17 | 18 |
18 class FakePaintedScrollbarLayer : public PaintedScrollbarLayer { | 19 class FakePaintedScrollbarLayer : public PaintedScrollbarLayer { |
19 public: | 20 public: |
20 static scoped_refptr<FakePaintedScrollbarLayer> Create( | 21 static scoped_refptr<FakePaintedScrollbarLayer> Create( |
21 bool paint_during_update, | 22 bool paint_during_update, |
22 bool has_thumb, | 23 bool has_thumb, |
23 int scrolling_layer_id); | 24 int scrolling_layer_id); |
24 int update_count() const { return update_count_; } | 25 int update_count() const { return update_count_; } |
25 void reset_update_count() { update_count_ = 0; } | 26 void reset_update_count() { update_count_ = 0; } |
26 | 27 |
27 bool Update() override; | 28 bool Update() override; |
28 | 29 |
29 void PushPropertiesTo(LayerImpl* layer) override; | 30 void PushPropertiesTo(LayerImpl* layer) override; |
30 | 31 |
31 scoped_ptr<base::AutoReset<bool>> IgnoreSetNeedsCommit(); | 32 std::unique_ptr<base::AutoReset<bool>> IgnoreSetNeedsCommit(); |
32 | 33 |
33 size_t push_properties_count() const { return push_properties_count_; } | 34 size_t push_properties_count() const { return push_properties_count_; } |
34 void reset_push_properties_count() { push_properties_count_ = 0; } | 35 void reset_push_properties_count() { push_properties_count_ = 0; } |
35 | 36 |
36 // For unit tests | 37 // For unit tests |
37 UIResourceId track_resource_id() { | 38 UIResourceId track_resource_id() { |
38 return PaintedScrollbarLayer::track_resource_id(); | 39 return PaintedScrollbarLayer::track_resource_id(); |
39 } | 40 } |
40 UIResourceId thumb_resource_id() { | 41 UIResourceId thumb_resource_id() { |
41 return PaintedScrollbarLayer::thumb_resource_id(); | 42 return PaintedScrollbarLayer::thumb_resource_id(); |
(...skipping 10 matching lines...) Expand all Loading... |
52 ~FakePaintedScrollbarLayer() override; | 53 ~FakePaintedScrollbarLayer() override; |
53 | 54 |
54 int update_count_; | 55 int update_count_; |
55 size_t push_properties_count_; | 56 size_t push_properties_count_; |
56 FakeScrollbar* fake_scrollbar_; | 57 FakeScrollbar* fake_scrollbar_; |
57 }; | 58 }; |
58 | 59 |
59 } // namespace cc | 60 } // namespace cc |
60 | 61 |
61 #endif // CC_TEST_FAKE_PAINTED_SCROLLBAR_LAYER_H_ | 62 #endif // CC_TEST_FAKE_PAINTED_SCROLLBAR_LAYER_H_ |
OLD | NEW |