| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_LINEAR_FADE_H_ | |
| 6 #define CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_LINEAR_FADE_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "cc/base/cc_export.h" | |
| 12 #include "cc/input/scrollbar_animation_controller.h" | |
| 13 | |
| 14 namespace cc { | |
| 15 | |
| 16 class CC_EXPORT ScrollbarAnimationControllerLinearFade | |
| 17 : public ScrollbarAnimationController { | |
| 18 public: | |
| 19 static std::unique_ptr<ScrollbarAnimationControllerLinearFade> Create( | |
| 20 int scroll_layer_id, | |
| 21 ScrollbarAnimationControllerClient* client, | |
| 22 base::TimeDelta delay_before_starting, | |
| 23 base::TimeDelta resize_delay_before_starting, | |
| 24 base::TimeDelta duration); | |
| 25 | |
| 26 ~ScrollbarAnimationControllerLinearFade() override; | |
| 27 | |
| 28 void DidScrollUpdate(bool on_resize) override; | |
| 29 | |
| 30 protected: | |
| 31 ScrollbarAnimationControllerLinearFade( | |
| 32 int scroll_layer_id, | |
| 33 ScrollbarAnimationControllerClient* client, | |
| 34 base::TimeDelta delay_before_starting, | |
| 35 base::TimeDelta resize_delay_before_starting, | |
| 36 base::TimeDelta duration); | |
| 37 | |
| 38 void RunAnimationFrame(float progress) override; | |
| 39 const base::TimeDelta& Duration() override; | |
| 40 | |
| 41 private: | |
| 42 float OpacityAtTime(base::TimeTicks now) const; | |
| 43 void ApplyOpacityToScrollbars(float opacity) override; | |
| 44 | |
| 45 base::TimeDelta duration_; | |
| 46 | |
| 47 DISALLOW_COPY_AND_ASSIGN(ScrollbarAnimationControllerLinearFade); | |
| 48 }; | |
| 49 | |
| 50 } // namespace cc | |
| 51 | |
| 52 #endif // CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_LINEAR_FADE_H_ | |
| OLD | NEW |