| Index: chrome/browser/profiles/profiles_state.cc
|
| diff --git a/chrome/browser/profiles/profiles_state.cc b/chrome/browser/profiles/profiles_state.cc
|
| index 62be3add6d38f38d49c4cbac7e14bf0eda86dec8..961fe6d941a988d8b5cf0fe47a7a78f5b55aff0f 100644
|
| --- a/chrome/browser/profiles/profiles_state.cc
|
| +++ b/chrome/browser/profiles/profiles_state.cc
|
| @@ -12,6 +12,8 @@
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/profiles/profile_info_cache.h"
|
| #include "chrome/browser/profiles/profile_manager.h"
|
| +#include "chrome/browser/signin/profile_oauth2_token_service.h"
|
| +#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
|
| #include "chrome/browser/ui/browser.h"
|
| #include "chrome/common/chrome_constants.h"
|
| #include "chrome/common/pref_names.h"
|
| @@ -101,4 +103,21 @@ void UpdateProfileName(Profile* profile,
|
| }
|
| }
|
|
|
| +std::vector<std::string> GetSecondaryAccountsForProfile(
|
| + Profile* profile,
|
| + const std::string& primary_account) {
|
| + std::vector<std::string> accounts =
|
| + ProfileOAuth2TokenServiceFactory::GetForProfile(profile)->GetAccounts();
|
| +
|
| + // The vector returned by ProfileOAuth2TokenService::GetAccounts() contains
|
| + // the primary account too, so we need to remove it from the list.
|
| + std::vector<std::string>::iterator primary_index =
|
| + std::find_if(accounts.begin(), accounts.end(),
|
| + std::bind1st(std::equal_to<std::string>(), primary_account));
|
| + DCHECK(primary_index != accounts.end());
|
| + accounts.erase(primary_index);
|
| +
|
| + return accounts;
|
| +}
|
| +
|
| } // namespace profiles
|
|
|