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

Unified Diff: ui/views/animation/ink_drop_animation_controller_impl.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_controller_impl.h
diff --git a/ui/views/animation/ink_drop_animation_controller_impl.h b/ui/views/animation/ink_drop_animation_controller_impl.h
index 4aede40cddab3c14727cca1ad4b9d8d72da712a4..0dfa83c92e69086470c46aa4efc164e09d9570ad 100644
--- a/ui/views/animation/ink_drop_animation_controller_impl.h
+++ b/ui/views/animation/ink_drop_animation_controller_impl.h
@@ -6,9 +6,11 @@
#define UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_CONTROLLER_IMPL_H_
#include "base/memory/scoped_ptr.h"
+#include "base/observer_list.h"
sadrul 2015/10/08 01:06:01 This isn't needed?
bruthig 2015/10/08 21:42:55 Whoops, not yet at least. Removed.
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
#include "ui/views/animation/ink_drop_animation_controller.h"
+#include "ui/views/animation/ink_drop_animation_observer.h"
#include "ui/views/views_export.h"
namespace views {
@@ -17,7 +19,8 @@ class InkDropHost;
// A functional implementation of an InkDropAnimationController.
class VIEWS_EXPORT InkDropAnimationControllerImpl
- : public InkDropAnimationController {
+ : public InkDropAnimationController,
+ public InkDropAnimationObserver {
public:
// Constructs an ink drop controller that will attach the ink drop to the
// given |ink_drop_host|.
@@ -26,7 +29,7 @@ class VIEWS_EXPORT InkDropAnimationControllerImpl
// InkDropAnimationController:
InkDropState GetInkDropState() const override;
- void AnimateToState(InkDropState state) override;
+ void AnimateToState(InkDropState ink_drop_state) override;
gfx::Size GetInkDropLargeSize() const override;
void SetInkDropSize(const gfx::Size& large_size,
int large_corner_radius,
@@ -36,10 +39,18 @@ class VIEWS_EXPORT InkDropAnimationControllerImpl
private:
// Creates a new InkDropAnimation and sets it to |ink_drop_animation_|. If
- // |ink_drop_animation_| wasn't null then it will be removed from the
- // |ink_drop_host_|.
+ // |ink_drop_animation_| wasn't null then it will be destroyed using
+ // DestroyInkDropAnimation().
void CreateInkDropAnimation();
+ // Destroys the current |ink_drop_animation_|.
+ void DestroyInkDropAnimation();
+
+ // views::InkDropAnimationObserver:
+ void InkDropAnimationStarted(InkDropState ink_drop_state) override;
+ void InkDropAnimationEnded(InkDropState ink_drop_state,
+ InkDropAnimationEndedReason reason) override;
+
// The host of the ink drop.
InkDropHost* ink_drop_host_;

Powered by Google App Engine
This is Rietveld 408576698