Index: ui/views/animation/ink_drop_host_view.cc |
diff --git a/ui/views/animation/ink_drop_host_view.cc b/ui/views/animation/ink_drop_host_view.cc |
index e6b1e424155d41e75056cdf1744fc2e7e2684fcc..acba512f0b23e5e95260e39b19f96abc78708e87 100644 |
--- a/ui/views/animation/ink_drop_host_view.cc |
+++ b/ui/views/animation/ink_drop_host_view.cc |
@@ -39,6 +39,8 @@ const int InkDropHostView::kInkDropSmallCornerRadius = 2; |
// An EventHandler that is guaranteed to be invoked and is not prone to |
// InkDropHostView descendents who do not call |
// InkDropHostView::OnGestureEvent(). |
+// Only one instance of this class can exist at any given time. Make sure to |
+// delete the old one, if any, *before* instantiating a new one. |
sadrul
2016/06/26 03:51:31
You mean only one instance can exist *for a partic
mohsen
2016/06/27 18:59:10
Right. Updated the comment.
|
// |
// TODO(bruthig): Consider getting rid of this class. |
class InkDropHostView::InkDropGestureHandler : public ui::EventHandler { |
@@ -221,11 +223,11 @@ bool InkDropHostView::ShouldShowInkDropForFocus() const { |
} |
void InkDropHostView::SetHasInkDrop(bool has_an_ink_drop) { |
+ gesture_handler_.reset(); |
if (has_an_ink_drop) { |
ink_drop_.reset(new InkDropImpl(this)); |
gesture_handler_.reset(new InkDropGestureHandler(this, ink_drop_.get())); |
sadrul
2016/06/26 03:51:31
Add a comment here that any existing InkDropGestur
mohsen
2016/06/27 18:59:10
Yes, Added SetInkDrop().
|
} else { |
- gesture_handler_.reset(); |
ink_drop_.reset(new InkDropStub()); |
} |
} |