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..6c2e540b17468172080ae6f43e2a19b6246c2d8f 100644 |
--- a/chrome/browser/ui/views/profile_chooser_view.cc |
+++ b/chrome/browser/ui/views/profile_chooser_view.cc |
@@ -791,22 +791,16 @@ 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. |
+ // from the others in the UI, so more work is likely required here: |
+ // crbug.com/311124. |
CreateAccountButton(layout, primary_account, true); |
- for (size_t i = 0; i < accounts.size(); ++i) { |
- if (primary_account != accounts[i]) |
- CreateAccountButton(layout, accounts[i], false); |
- } |
+ for (size_t i = 0; i < accounts.size(); ++i) |
+ CreateAccountButton(layout, accounts[i], false); |
layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |