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

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 (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/test/test_ink_drop_host.cc ('k') | ui/views/controls/button/custom_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ef250c0b81f1087bc8b3478f4db6138421c4a67b 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 SetInkDropDelegate(scoped_ptr<InkDropDelegate> ink_drop_delegate);
+ 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_;
« no previous file with comments | « ui/views/animation/test/test_ink_drop_host.cc ('k') | ui/views/controls/button/custom_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698