OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #include "cc/input/scrollbar_animation_controller_linear_fade.h" | 5 #include "cc/input/scrollbar_animation_controller_linear_fade.h" |
6 | 6 |
| 7 #include "base/memory/ptr_util.h" |
7 #include "base/time/time.h" | 8 #include "base/time/time.h" |
8 #include "cc/layers/layer_impl.h" | 9 #include "cc/layers/layer_impl.h" |
9 #include "cc/layers/scrollbar_layer_impl_base.h" | 10 #include "cc/layers/scrollbar_layer_impl_base.h" |
10 | 11 |
11 namespace cc { | 12 namespace cc { |
12 | 13 |
13 scoped_ptr<ScrollbarAnimationControllerLinearFade> | 14 std::unique_ptr<ScrollbarAnimationControllerLinearFade> |
14 ScrollbarAnimationControllerLinearFade::Create( | 15 ScrollbarAnimationControllerLinearFade::Create( |
15 int scroll_layer_id, | 16 int scroll_layer_id, |
16 ScrollbarAnimationControllerClient* client, | 17 ScrollbarAnimationControllerClient* client, |
17 base::TimeDelta delay_before_starting, | 18 base::TimeDelta delay_before_starting, |
18 base::TimeDelta resize_delay_before_starting, | 19 base::TimeDelta resize_delay_before_starting, |
19 base::TimeDelta duration) { | 20 base::TimeDelta duration) { |
20 return make_scoped_ptr(new ScrollbarAnimationControllerLinearFade( | 21 return base::WrapUnique(new ScrollbarAnimationControllerLinearFade( |
21 scroll_layer_id, client, delay_before_starting, | 22 scroll_layer_id, client, delay_before_starting, |
22 resize_delay_before_starting, duration)); | 23 resize_delay_before_starting, duration)); |
23 } | 24 } |
24 | 25 |
25 ScrollbarAnimationControllerLinearFade::ScrollbarAnimationControllerLinearFade( | 26 ScrollbarAnimationControllerLinearFade::ScrollbarAnimationControllerLinearFade( |
26 int scroll_layer_id, | 27 int scroll_layer_id, |
27 ScrollbarAnimationControllerClient* client, | 28 ScrollbarAnimationControllerClient* client, |
28 base::TimeDelta delay_before_starting, | 29 base::TimeDelta delay_before_starting, |
29 base::TimeDelta resize_delay_before_starting, | 30 base::TimeDelta resize_delay_before_starting, |
30 base::TimeDelta duration) | 31 base::TimeDelta duration) |
(...skipping 22 matching lines...) Expand all Loading... |
53 float opacity) { | 54 float opacity) { |
54 for (ScrollbarLayerImplBase* scrollbar : Scrollbars()) { | 55 for (ScrollbarLayerImplBase* scrollbar : Scrollbars()) { |
55 if (!scrollbar->is_overlay_scrollbar()) | 56 if (!scrollbar->is_overlay_scrollbar()) |
56 continue; | 57 continue; |
57 scrollbar->OnOpacityAnimated(scrollbar->CanScrollOrientation() ? opacity | 58 scrollbar->OnOpacityAnimated(scrollbar->CanScrollOrientation() ? opacity |
58 : 0); | 59 : 0); |
59 } | 60 } |
60 } | 61 } |
61 | 62 |
62 } // namespace cc | 63 } // namespace cc |
OLD | NEW |