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

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

Issue 1373983002: Enhanced the InkDropRippleImpl to create/destroy InkDropAnimations as needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Based diff delta on dependant branch. Created 5 years, 2 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
new file mode 100644
index 0000000000000000000000000000000000000000..2a866ede671881365231e0abcb936b9acc41e9ca
--- /dev/null
+++ b/ui/views/animation/ink_drop_animation_observer.h
@@ -0,0 +1,52 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_OBSERVER_H_
+#define UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_OBSERVER_H_
+
+#include <iosfwd>
+
+#include "base/macros.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 pre-maturely before reaching it's final state.
varkha 2015/10/06 20:58:38 nit: s/pre-maturely/prematurely ; s/it's/its
bruthig 2015/10/08 21:42:55 Done.
+ 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 it's final frame however if |reason|
varkha 2015/10/06 20:58:38 nit: here and below - s/it's/its.
bruthig 2015/10/08 21:42:55 Done.
+ // is |PRE_EMPTED| then the animation was stopped before it's final frame.
sadrul 2015/10/08 01:06:01 Is it possible to start the animation for one stat
bruthig 2015/10/08 21:42:55 Done.
+ virtual void InkDropAnimationEnded(InkDropState ink_drop_state,
+ InkDropAnimationEndedReason reason) = 0;
+
+ protected:
+ InkDropAnimationObserver() {}
+ virtual ~InkDropAnimationObserver() {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(InkDropAnimationObserver);
+};
+
+VIEWS_EXPORT std::ostream& operator<<(
sadrul 2015/10/08 01:06:01 Is this actually useful/necessary?
bruthig 2015/10/08 21:42:55 Replaced with a ToString().
+ std::ostream& out,
+ InkDropAnimationObserver::InkDropAnimationEndedReason reason);
+
+} // namespace views
+
+#endif // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_OBSERVER_H_

Powered by Google App Engine
This is Rietveld 408576698