Commit 5c189179 authored by David Roger's avatar David Roger Committed by Commit Bot

[IdentityPill] Don't show the pill if signed out while downloading image

This is a fix for the following scenario:
- user signs in or opens Chrome
- image starts downloading
- user signs out
- image download completes
- pill is shown while signed out

The fix is to check that the user is still signed in when the download
completes.

Fixed: 1025674
Change-Id: I780731d23b6e89beba343c27c947c284172584ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1919920Reviewed-by: default avatarMonica Basta <msalama@chromium.org>
Commit-Queue: David Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#716142}
parent c06335fd
......@@ -420,6 +420,16 @@ void AvatarToolbarButton::OnHighlightChanged() {
void AvatarToolbarButton::ShowIdentityAnimation() {
DCHECK_EQ(identity_animation_state_,
IdentityAnimationState::kWaitingForImage);
// Check that the user is still signed in. See https://crbug.com/1025674
CoreAccountInfo user_identity =
IdentityManagerFactory::GetForProfile(profile_)
->GetUnconsentedPrimaryAccountInfo();
if (user_identity.IsEmpty()) {
identity_animation_state_ = IdentityAnimationState::kNotShowing;
return;
}
identity_animation_state_ = IdentityAnimationState::kShowingUntilTimeout;
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