Commit fb7068fc authored by Jan Krcal's avatar Jan Krcal Committed by Commit Bot

[Avatar button] Don't show saving highlight in sync paused/error

This CL changes behavior for the save-moment highlight animation: the
animation now does not appear when in sync paused/error states.

The previous behavior was visually jarring with too many moving pieces
(as well as buggy at the same time). The new behavior was chosen with UX
as the best option mergeable to M79.

Bug: 1016716
Change-Id: I706d5ff3533cbcd101b982e6db8e3cc2602adb21
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1883511
Commit-Queue: Jan Krcal <jkrcal@chromium.org>
Auto-Submit: Jan Krcal <jkrcal@chromium.org>
Reviewed-by: default avatarThomas Tangl <tangltom@chromium.org>
Cr-Commit-Position: refs/heads/master@{#709920}
parent 35c8ccd7
......@@ -564,7 +564,7 @@ AvatarToolbarButton::State AvatarToolbarButton::GetState() const {
#if !defined(OS_CHROMEOS)
if (identity_manager->HasPrimaryAccount() && profile_->IsSyncAllowed() &&
error_controller_.HasAvatarError() && !highlight_animation_visible_) {
error_controller_.HasAvatarError()) {
// When DICE is enabled and the error is an auth error, the sync-paused
// icon is shown.
int unused;
......@@ -612,23 +612,15 @@ void AvatarToolbarButton::OnUserIdentityChanged(
}
void AvatarToolbarButton::ShowHighlightAnimation() {
DCHECK_NE(GetState(), State::kIncognitoProfile);
DCHECK_NE(GetState(), State::kGuestSession);
highlight_animation_visible_ = true;
// TODO(crbug.com/932818): Avatar highlight animation should not be shown when
// the sign-in animation is visible. We will figure out the direction moving
// forward when all the pieces come together.
// Button state should be checked before text is updated, but after the
// |highlight_animation_visible_| is set to true.
DCHECK(GetState() == State::kNormal || GetState() == State::kGenericProfile ||
GetState() == State::kAnimatedUserIdentity);
UpdateText();
}
void AvatarToolbarButton::HideHighlightAnimation() {
// TODO(crbug.com/932818): Avatar highlight animation should not be shown when
// the sign-in animation is visible. We will figure out the direction moving
// forward when all the pieces come together.
DCHECK(GetState() == State::kNormal || GetState() == State::kGenericProfile ||
GetState() == State::kAnimatedUserIdentity);
DCHECK_NE(GetState(), State::kIncognitoProfile);
DCHECK_NE(GetState(), State::kGuestSession);
highlight_animation_visible_ = false;
UpdateText();
......
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