Commit e0cbe4cf authored by siyua's avatar siyua Committed by Commit Bot

[Status Chip] Fix local card migration icon highlight

Previously the icon did not set highlight ink drop animation correctly
that it did not go through Button::SetHighlighted(bool). It is needed
because the status chip container is a button observer which observes
button highlight state changes, and then update its own highlight status.
This is only triggered by SetHighlighted().

Add (before and after) screenshots in bug comment 28

Bug: 932818
Change-Id: I2e6c2e9a6b7302652761aa548dd777995c01436a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1827750Reviewed-by: default avatarPeter Boström <pbos@chromium.org>
Commit-Queue: Siyu An <siyua@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700885}
parent c066fa15
...@@ -70,11 +70,11 @@ bool LocalCardMigrationIconView::Update() { ...@@ -70,11 +70,11 @@ bool LocalCardMigrationIconView::Update() {
// credit card icon. // credit card icon.
case LocalCardMigrationFlowStep::OFFER_DIALOG: { case LocalCardMigrationFlowStep::OFFER_DIALOG: {
UpdateIconImage(); UpdateIconImage();
AnimateInkDrop(views::InkDropState::ACTIVATED, /*event=*/nullptr); SetHighlighted(true);
break; break;
} }
case LocalCardMigrationFlowStep::MIGRATION_RESULT_PENDING: { case LocalCardMigrationFlowStep::MIGRATION_RESULT_PENDING: {
AnimateInkDrop(views::InkDropState::HIDDEN, /*event=*/nullptr); SetHighlighted(false);
// Disable the credit card icon so it does not update if user clicks // Disable the credit card icon so it does not update if user clicks
// on it. // on it.
SetEnabled(false); SetEnabled(false);
...@@ -95,6 +95,7 @@ bool LocalCardMigrationIconView::Update() { ...@@ -95,6 +95,7 @@ bool LocalCardMigrationIconView::Update() {
break; break;
} }
} else { } else {
SetHighlighted(false);
// Handle corner cases where users navigate away or close the tab. // Handle corner cases where users navigate away or close the tab.
UnpauseAnimation(); UnpauseAnimation();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment