Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Unified Diff: ui/views/animation/ink_drop_animation_observer.h

Issue 1896953003: Added a views::test::TestInkDropAnimationObserverHelper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added test_animation_observer.h file. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views/animation/ink_drop_animation_observer.h
diff --git a/ui/views/animation/ink_drop_animation_observer.h b/ui/views/animation/ink_drop_animation_observer.h
index 3eb3b1d2412bf57f8c80682c09bf19996cacc4f6..0c0213de9286ff590bda7e65d57d1f0c876e54b6 100644
--- a/ui/views/animation/ink_drop_animation_observer.h
+++ b/ui/views/animation/ink_drop_animation_observer.h
@@ -5,51 +5,14 @@
#ifndef UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_OBSERVER_H_
#define UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_OBSERVER_H_
-#include <string>
-
-#include "base/macros.h"
+#include "ui/views/animation/animation_observer.h"
#include "ui/views/animation/ink_drop_state.h"
-#include "ui/views/views_export.h"
namespace views {
-// Pure-virtual base class of an observer that can be attached to
-// InkDropAnimations.
-class VIEWS_EXPORT InkDropAnimationObserver {
- public:
- // Enumeration of the different reasons why an InkDropAnimation has finished.
- enum InkDropAnimationEndedReason {
- // The animation was completed successfully.
- SUCCESS,
- // The animation was stopped prematurely before reaching its final state.
- PRE_EMPTED
- };
-
- // Notifies the observer that an animation for |ink_drop_state| has started.
- virtual void InkDropAnimationStarted(InkDropState ink_drop_state) = 0;
-
- // Notifies the observer that an animation for |ink_drop_state| has finished
- // and the reason for completion is given by |reason|. If |reason| is SUCCESS
- // then the animation has progressed to its final frame however if |reason|
- // is |PRE_EMPTED| then the animation was stopped before its final frame. In
- // the event that an animation is in progress for ink drop state 's1' and an
- // animation to a new state 's2' is triggered, then
- // InkDropAnimationEnded(s1, PRE_EMPTED) will be called before
- // InkDropAnimationStarted(s2).
- virtual void InkDropAnimationEnded(InkDropState ink_drop_state,
- InkDropAnimationEndedReason reason) = 0;
-
- protected:
- InkDropAnimationObserver() {}
- virtual ~InkDropAnimationObserver() {}
-
- private:
- DISALLOW_COPY_AND_ASSIGN(InkDropAnimationObserver);
-};
-
-// Returns a human readable string for |reason|. Useful for logging.
-std::string ToString(
- InkDropAnimationObserver::InkDropAnimationEndedReason reason);
+// The same type as used by InkDropAnimation::set_observer(). Observer classes
+// should inherit from this typedef.
+typedef AnimationObserver<InkDropState> InkDropAnimationObserver;
sky 2016/04/20 19:38:47 typedef->using
bruthig 2016/04/20 21:20:09 Done.
} // namespace views

Powered by Google App Engine
This is Rietveld 408576698