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

Unified Diff: ui/views/controls/button/custom_button.h

Issue 1494433003: Fixes a crash when InkDropDelegate gets destroyed after its InkDropHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes a crash when InkDropDelegate gets destroyed after its InkDropHost (delegate owned by a leaf c… Created 5 years 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/ink_drop_delegate_unittest.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 ef250c0b81f1087bc8b3478f4db6138421c4a67b..2f3508f453fb2536847deacccf41e29e8d288dba 100644
--- a/ui/views/controls/button/custom_button.h
+++ b/ui/views/controls/button/custom_button.h
@@ -126,9 +126,9 @@ 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();
+ InkDropDelegate* ink_drop_delegate() const { return ink_drop_delegate_; }
+ void set_ink_drop_delegate(InkDropDelegate* ink_drop_delegate) {
+ ink_drop_delegate_ = ink_drop_delegate;
}
// Overridden from View:
@@ -161,8 +161,10 @@ 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_;
+ // Animation delegate for the ink drop ripple effect. It is owned by a
+ // descendant class and needs to be reset before an instance of the concrete
+ // CustomButton is destroyed.
+ 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/ink_drop_delegate_unittest.cc ('k') | ui/views/controls/button/custom_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698