Chromium Code Reviews| Index: chrome/browser/ui/views/profile_chooser_view.cc |
| diff --git a/chrome/browser/ui/views/profile_chooser_view.cc b/chrome/browser/ui/views/profile_chooser_view.cc |
| index 03a5fd3fb5cf816facae9f1bb6642239eda9bc85..595b46d570e62bca1e48cbe82aec5627d0f67797 100644 |
| --- a/chrome/browser/ui/views/profile_chooser_view.cc |
| +++ b/chrome/browser/ui/views/profile_chooser_view.cc |
| @@ -791,21 +791,15 @@ views::View* ProfileChooserView::CreateCurrentProfileAccountsView( |
| std::string primary_account = |
| SigninManagerFactory::GetForProfile(profile)->GetAuthenticatedUsername(); |
| DCHECK(!primary_account.empty()); |
| - std::vector<std::string> accounts( |
| - ProfileOAuth2TokenServiceFactory::GetForProfile(profile)->GetAccounts()); |
| - DCHECK_EQ(1, std::count_if(accounts.begin(), accounts.end(), |
| - std::bind1st(std::equal_to<std::string>(), |
| - primary_account))); |
| - |
| - // The primary account should always be listed first. However, the vector |
| - // returned by ProfileOAuth2TokenService::GetAccounts() will contain the |
| - // primary account too. Ignore it when it appears later. |
| + std::vector<std::string>accounts = |
| + profiles::GetSecondaryAccountsForProfile(profile, primary_account); |
| + |
| + // The primary account should always be listed first. |
| // TODO(rogerta): we still need to further differentiate the primary account |
| // from the others, so more work is likely required here: crbug.com/311124. |
| CreateAccountButton(layout, primary_account, true); |
| for (size_t i = 0; i < accounts.size(); ++i) { |
|
sky
2014/01/08 21:00:15
nit: remove {}
noms (inactive)
2014/01/08 21:04:27
Eeek, oops. Done.
On 2014/01/08 21:00:15, sky wrot
|
| - if (primary_account != accounts[i]) |
| - CreateAccountButton(layout, accounts[i], false); |
| + CreateAccountButton(layout, accounts[i], false); |
| } |
| layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |