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

Unified Diff: ui/views/controls/button/custom_button.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 (more comments in ui/views/, test) 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
Index: ui/views/controls/button/custom_button.h
diff --git a/ui/views/controls/button/custom_button.h b/ui/views/controls/button/custom_button.h
index 869bcd77af5dac05115312e726c984cf58aac1cf..f8c4105af28542528e0404acff1c98d2eb89d6a9 100644
--- a/ui/views/controls/button/custom_button.h
+++ b/ui/views/controls/button/custom_button.h
@@ -16,6 +16,8 @@ class ThrobAnimation;
namespace views {
+class InkDropDelegate;
+
// A button with custom rendering. The base of ImageButton and LabelButton.
// Note that this type of button is not focusable by default and will not be
// part of the focus chain. Call SetFocusable(true) to make it part of the
@@ -76,6 +78,7 @@ class VIEWS_EXPORT CustomButton : public Button,
bool IsHotTracked() const;
// Overridden from View:
+ void Layout() override;
void OnEnabledChanged() override;
const char* GetClassName() const override;
bool OnMousePressed(const ui::MouseEvent& event) override;
@@ -123,7 +126,13 @@ class VIEWS_EXPORT CustomButton : public Button,
// state). This does not take into account enabled state.
bool ShouldEnterHoveredState();
+ void set_ink_drop_delegate(InkDropDelegate* ink_drop_delegate);
sadrul 2015/11/27 05:59:35 SetInkDropDelegate(scoped_ptr<...>) to clarify th
varkha 2015/11/27 15:17:02 Done.
+ InkDropDelegate* ink_drop_delegate() const {
+ return ink_drop_delegate_.get();
+ }
+
// Overridden from View:
+ void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
void ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) override;
void OnBlur() override;
@@ -152,6 +161,9 @@ class VIEWS_EXPORT CustomButton : public Button,
// See description above setter.
bool request_focus_on_press_;
+ // Animation delegate for the ink drop ripple effect.
+ scoped_ptr<InkDropDelegate> ink_drop_delegate_;
+
// The event on which the button should notify its listener.
NotifyAction notify_action_;

Powered by Google App Engine
This is Rietveld 408576698