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

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 (comments 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
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..a70d867e0da845f8269d95f13a50e1a178c803a6 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
@@ -124,16 +126,24 @@ class VIEWS_EXPORT CustomButton : public Button,
bool ShouldEnterHoveredState();
// Overridden from View:
+ void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
void ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) override;
void OnBlur() override;
+ InkDropDelegate* ink_drop_delegate() const {
+ return ink_drop_delegate_.get();
+ }
sadrul 2015/11/25 22:38:58 non-overrides before overrides. So this should mov
varkha 2015/11/26 00:05:47 Done.
+
// The button state (defined in implementation)
ButtonState state_;
// Hover animation.
scoped_ptr<gfx::ThrobAnimation> hover_animation_;
+ // Animation delegate for the ink drop ripple effect.
+ scoped_ptr<InkDropDelegate> ink_drop_delegate_;
sadrul 2015/11/25 22:38:58 Should be a private member.
varkha 2015/11/26 00:05:47 Done.
+
private:
// Returns true if this is not a top level widget. Virtual for tests.
virtual bool IsChildWidget() const;

Powered by Google App Engine
This is Rietveld 408576698