| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 #ifndef CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_THINNING_H_ | |
| 6 #define CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_THINNING_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 #include "cc/input/single_scrollbar_animation_controller_thinning.h" | |
| 14 | |
| 15 namespace cc { | |
| 16 | |
| 17 // This class fade in scrollbars when scroll and fade out after an idle delay. | |
| 18 // The fade animations works on both scrollbars and is controlled in this class. | |
| 19 | |
| 20 // TODO(chaopeng) clean up the inheritance hierarchy after | |
| 21 // ScrollbarAnimationControllerLinearFade merge into | |
| 22 // ScrollbarAnimationControllerThinning so we can remove the empty overrides and | |
| 23 // NOTREACHED() checks. | |
| 24 class CC_EXPORT ScrollbarAnimationControllerThinning | |
| 25 : public ScrollbarAnimationController { | |
| 26 public: | |
| 27 static std::unique_ptr<ScrollbarAnimationControllerThinning> Create( | |
| 28 int scroll_layer_id, | |
| 29 ScrollbarAnimationControllerClient* client, | |
| 30 base::TimeDelta delay_before_starting, | |
| 31 base::TimeDelta resize_delay_before_starting, | |
| 32 base::TimeDelta fade_duration, | |
| 33 base::TimeDelta thinning_duration); | |
| 34 | |
| 35 ~ScrollbarAnimationControllerThinning() override; | |
| 36 | |
| 37 void DidScrollUpdate(bool on_resize) override; | |
| 38 void DidScrollEnd() override; | |
| 39 bool ScrollbarsHidden() const override; | |
| 40 | |
| 41 protected: | |
| 42 bool NeedThinningAnimation() const override; | |
| 43 | |
| 44 private: | |
| 45 ScrollbarAnimationControllerThinning( | |
| 46 int scroll_layer_id, | |
| 47 ScrollbarAnimationControllerClient* client, | |
| 48 base::TimeDelta delay_before_starting, | |
| 49 base::TimeDelta resize_delay_before_starting, | |
| 50 base::TimeDelta fade_duration, | |
| 51 base::TimeDelta thinning_duration); | |
| 52 | |
| 53 void ApplyOpacityToScrollbars(float opacity) override; | |
| 54 void RunAnimationFrame(float progress) override; | |
| 55 const base::TimeDelta& Duration() override; | |
| 56 | |
| 57 float opacity_; | |
| 58 base::TimeDelta fade_duration_; | |
| 59 | |
| 60 DISALLOW_COPY_AND_ASSIGN(ScrollbarAnimationControllerThinning); | |
| 61 }; | |
| 62 | |
| 63 } // namespace cc | |
| 64 | |
| 65 #endif // CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_THINNING_H_ | |
| OLD | NEW |