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

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

Issue 1411833006: Refactoring to make adding ink drop animations easier (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactor ink drop animations (nits in ui/views/ Created 5 years, 1 month 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
« no previous file with comments | « ui/views/animation/button_ink_drop_delegate.cc ('k') | ui/views/animation/ink_drop_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/animation/ink_drop_delegate.h
diff --git a/ui/views/animation/ink_drop_delegate.h b/ui/views/animation/ink_drop_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..f8f7861d2c9d43c875c5aa81c3b084c070af489a
--- /dev/null
+++ b/ui/views/animation/ink_drop_delegate.h
@@ -0,0 +1,48 @@
+// 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_DELEGATE_H_
+#define UI_VIEWS_ANIMATION_INK_DROP_DELEGATE_H_
+
+#include "base/macros.h"
+#include "ui/views/animation/ink_drop_state.h"
+#include "ui/views/views_export.h"
+
+namespace ui {
+class GestureEvent;
+class Event;
+} // namespace ui
+
+namespace views {
+
+// Ink ripple animation delegate that starts and stops animations based on
+// View states and events.
+class VIEWS_EXPORT InkDropDelegate {
+ public:
+ InkDropDelegate() {}
+ virtual ~InkDropDelegate() {}
+
+ // Sets sizes for the animation layers that are squares with |large_size| and
+ // |small_size| being the length of each side. When painting rounded squares
+ // |large_corner_radius| and |small_corner_radius| are specifying the
+ // corner radius.
+ virtual void SetInkDropSize(int large_size,
+ int large_corner_radius,
+ int small_size,
+ int small_corner_radius) = 0;
+
+ // Called when the bounds or layout of the View changes necessitating change
+ // in positioning of ink ripple layers.
+ virtual void OnLayout() = 0;
+
+ // Called when ink ripple state changes.
+ virtual void OnAction(InkDropState state) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(InkDropDelegate);
+};
+
+} // namespace views
+
+#endif // UI_VIEWS_ANIMATION_INK_DROP_DELEGATE_H_
« no previous file with comments | « ui/views/animation/button_ink_drop_delegate.cc ('k') | ui/views/animation/ink_drop_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698