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

Unified Diff: ui/views/animation/ink_drop_impl.cc

Issue 2487723003: [ash-md] Fixed crash when DEACTIVATING a focused ink drop button. (Closed)
Patch Set: Created 4 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/animation/ink_drop_impl.cc
diff --git a/ui/views/animation/ink_drop_impl.cc b/ui/views/animation/ink_drop_impl.cc
index cc5f07966b689f01597a86b4f3f6fc30db6ba54e..0ec1aefd6149484a5282fd9309cbd50a28bf1733 100644
--- a/ui/views/animation/ink_drop_impl.cc
+++ b/ui/views/animation/ink_drop_impl.cc
@@ -315,8 +315,13 @@ void InkDropImpl::HideHighlightOnRippleHiddenState::OnFocusChanged() {
void InkDropImpl::HideHighlightOnRippleHiddenState::AnimationStarted(
InkDropState ink_drop_state) {
if (ink_drop_state == views::InkDropState::DEACTIVATED &&
- GetInkDrop()->is_focused_) {
- GetInkDrop()->ink_drop_ripple_->HideImmediately();
+ GetInkDrop()->ShouldHighlightBasedOnFocus()) {
+ // It's possible to get animation started events when destroying the
+ // |ink_drop_ripple_|.
+ // TODO(bruthig): Investigate if the animation framework can address this
+ // issue instead. See https://crbug.com/663335.
+ if (GetInkDrop()->ink_drop_ripple_)
+ GetInkDrop()->ink_drop_ripple_->HideImmediately();
GetInkDrop()->SetHighlightState(
state_factory()->CreateVisibleState(base::TimeDelta(), false));
}
« no previous file with comments | « no previous file | ui/views/animation/ink_drop_impl_unittest.cc » ('j') | ui/views/animation/ink_drop_impl_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698