Index: chrome/browser/profiles/profile_downloader.cc |
diff --git a/chrome/browser/profiles/profile_downloader.cc b/chrome/browser/profiles/profile_downloader.cc |
index 9a7a7154cd45407dc904f71e0a7ec4aa853f51de..7248e53518fadd49002e1fd32e706589a469fe6b 100644 |
--- a/chrome/browser/profiles/profile_downloader.cc |
+++ b/chrome/browser/profiles/profile_downloader.cc |
@@ -19,6 +19,8 @@ |
#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/signin/signin_manager.h" |
+#include "chrome/browser/signin/signin_manager_factory.h" |
#include "content/public/browser/browser_thread.h" |
#include "google_apis/gaia/gaia_constants.h" |
#include "google_apis/gaia/gaia_urls.h" |
@@ -233,8 +235,11 @@ void ProfileDownloader::StartForAccount(const std::string& account_id) { |
return; |
} |
+ SigninManagerBase* signin_manager = |
+ SigninManagerFactory::GetForProfile(delegate_->GetBrowserProfile()); |
account_id_ = |
- account_id.empty() ? service->GetPrimaryAccountId() : account_id; |
+ account_id.empty() ? |
+ signin_manager->GetAuthenticatedAccountId() : account_id; |
if (service->RefreshTokenIsAvailable(account_id_)) { |
StartFetchingOAuth2AccessToken(); |
} else { |