Commit 8244a2fd authored by Thomas Tangl's avatar Thomas Tangl Committed by Commit Bot

[Dice] Only show the sync promo account icon when migrated to Dice

The account icon of the first sync promo account is now only
shown in the avatar toolbar when the profile is fully migrated to Dice.

Bug: 889325
Change-Id: I75dfbbc4cbf24d94e42d3b243dce15cb857066f0
Reviewed-on: https://chromium-review.googlesource.com/1249268
Commit-Queue: Thomas Tangl <tangltom@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594793}
parent b1b00d46
...@@ -294,9 +294,13 @@ gfx::Image AvatarToolbarButton::GetIconImageFromProfile() const { ...@@ -294,9 +294,13 @@ gfx::Image AvatarToolbarButton::GetIconImageFromProfile() const {
} }
#if !defined(OS_CHROMEOS) #if !defined(OS_CHROMEOS)
// If the user isn't signed in and the profile icon wasn't changed explicitly, // Try to show the first account icon of the sync promo when the following
// try to use the first account icon of the sync promo. // conditions are satisfied:
if (!SigninManagerFactory::GetForProfile(profile_)->IsAuthenticated() && // - the user is migrated to Dice
// - the user isn't signed in
// - the profile icon wasn't explicitly changed
if (AccountConsistencyModeManager::IsDiceEnabledForProfile(profile_) &&
!SigninManagerFactory::GetForProfile(profile_)->IsAuthenticated() &&
entry->IsUsingDefaultAvatar()) { entry->IsUsingDefaultAvatar()) {
std::vector<AccountInfo> promo_accounts = std::vector<AccountInfo> promo_accounts =
signin_ui_util::GetAccountsForDicePromos(profile_); signin_ui_util::GetAccountsForDicePromos(profile_);
......
...@@ -484,15 +484,10 @@ IN_PROC_BROWSER_TEST_F(ProfileChooserViewExtensionsTest, ...@@ -484,15 +484,10 @@ IN_PROC_BROWSER_TEST_F(ProfileChooserViewExtensionsTest,
ShowAndVerifyUi(); ShowAndVerifyUi();
} }
// Crashes on Win only. http://crbug.com/820390 // Crashes because account consistency changes: http://crbug.com/820390
#if defined(OS_WIN)
#define MAYBE_InvokeUi_SupervisedUser DISABLED_InvokeUi_SupervisedUser
#else
#define MAYBE_InvokeUi_SupervisedUser InvokeUi_SupervisedUser
#endif
// Shows the |ProfileChooserView| when a supervised user is the active profile. // Shows the |ProfileChooserView| when a supervised user is the active profile.
IN_PROC_BROWSER_TEST_F(ProfileChooserViewExtensionsTest, IN_PROC_BROWSER_TEST_F(ProfileChooserViewExtensionsTest,
MAYBE_InvokeUi_SupervisedUser) { DISABLED_InvokeUi_SupervisedUser) {
ScopedAccountConsistencyDiceFixAuthErrors scoped_account_consistency; ScopedAccountConsistencyDiceFixAuthErrors scoped_account_consistency;
ShowAndVerifyUi(); ShowAndVerifyUi();
} }
......
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