ink_drop_observer.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright 2017 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 UI_VIEWS_ANIMATION_INK_DROP_OBSERVER_H_
  5. #define UI_VIEWS_ANIMATION_INK_DROP_OBSERVER_H_
  6. #include "ui/views/animation/ink_drop_state.h"
  7. #include "ui/views/views_export.h"
  8. namespace views {
  9. // Observer to attach to an InkDrop.
  10. class VIEWS_EXPORT InkDropObserver {
  11. public:
  12. InkDropObserver(const InkDropObserver&) = delete;
  13. InkDropObserver& operator=(const InkDropObserver&) = delete;
  14. // Called when the animation of the current InkDrop has started. This
  15. // includes the ripple or highlight animation. Note: this is not guaranteed to
  16. // be notified, as the notification is dependent on the subclass
  17. // implementation.
  18. virtual void InkDropAnimationStarted() = 0;
  19. // Called when the animation to the provided ink drop state has ended (both if
  20. // the animation ended successfully, and if the animation was aborted).
  21. // Includes ripple animation only.
  22. // NOTE: this is not guaranteed to be notified, as the notification is
  23. // dependent on the subclass implementation.
  24. // |ink_drop_state| - The state to which the ink drop ripple was animating.
  25. virtual void InkDropRippleAnimationEnded(InkDropState ink_drop_state) = 0;
  26. protected:
  27. InkDropObserver() = default;
  28. virtual ~InkDropObserver() = default;
  29. };
  30. } // namespace views
  31. #endif // UI_VIEWS_ANIMATION_INK_DROP_OBSERVER_H_