progress_icon_animation.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2022 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. #ifndef ASH_SYSTEM_PROGRESS_INDICATOR_PROGRESS_ICON_ANIMATION_H_
  5. #define ASH_SYSTEM_PROGRESS_INDICATOR_PROGRESS_ICON_ANIMATION_H_
  6. #include "ash/ash_export.h"
  7. #include "ash/system/progress_indicator/progress_indicator_animation.h"
  8. namespace ash {
  9. // An animation for a `ProgressIndicator`'s icon.
  10. class ASH_EXPORT ProgressIconAnimation : public ProgressIndicatorAnimation {
  11. public:
  12. ProgressIconAnimation();
  13. ProgressIconAnimation(const ProgressIconAnimation&) = delete;
  14. ProgressIconAnimation& operator=(const ProgressIconAnimation&) = delete;
  15. ~ProgressIconAnimation() override;
  16. // Animatable properties.
  17. float inner_icon_translate_y_scale_factor() const {
  18. return inner_icon_translate_y_scale_factor_;
  19. }
  20. float inner_ring_stroke_width_scale_factor() const {
  21. return inner_ring_stroke_width_scale_factor_;
  22. }
  23. float opacity() const { return opacity_; }
  24. private:
  25. // ProgressIndicatorAnimation:
  26. void UpdateAnimatableProperties(double fraction) override;
  27. // Animatable properties.
  28. float inner_icon_translate_y_scale_factor_ = -0.5f;
  29. float inner_ring_stroke_width_scale_factor_ = 0.f;
  30. float opacity_ = 0.f;
  31. };
  32. } // namespace ash
  33. #endif // ASH_SYSTEM_PROGRESS_INDICATOR_PROGRESS_ICON_ANIMATION_H_