| Index: chrome/browser/profiles/profile_downloader.cc
|
| diff --git a/chrome/browser/profiles/profile_downloader.cc b/chrome/browser/profiles/profile_downloader.cc
|
| index a3e6669c4cfdf7b04a1e432fbaf61ea0d63207f0..14b5726b086f2086f5435cf74f8bbe2e77796ab7 100644
|
| --- a/chrome/browser/profiles/profile_downloader.cc
|
| +++ b/chrome/browser/profiles/profile_downloader.cc
|
| @@ -16,6 +16,8 @@
|
| #include "base/values.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/profiles/profile_downloader_delegate.h"
|
| +#include "chrome/browser/signin/about_signin_internals.h"
|
| +#include "chrome/browser/signin/about_signin_internals_factory.h"
|
| #include "chrome/browser/signin/token_service.h"
|
| #include "chrome/browser/signin/token_service_factory.h"
|
| #include "chrome/common/chrome_notification_types.h"
|
| @@ -390,6 +392,16 @@ void ProfileDownloader::Observe(
|
| // used to start fetching user data.
|
| void ProfileDownloader::OnGetTokenSuccess(const std::string& access_token,
|
| const base::Time& expiration_time) {
|
| + // TODO(vishwath): This can be removed when refactoring this class to use
|
| + // OAuth2TokenService instead.
|
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| + Profile* profile = delegate_->GetBrowserProfile();
|
| + DCHECK(profile);
|
| + AboutSigninInternalsFactory::GetForProfile(profile)->
|
| + NotifyTokenReceivedSuccess(signin_internals_util::kProfileDownloaderToken,
|
| + access_token,
|
| + true);
|
| +
|
| auth_token_ = access_token;
|
| StartFetchingImage();
|
| }
|
| @@ -397,6 +409,15 @@ void ProfileDownloader::OnGetTokenSuccess(const std::string& access_token,
|
| // Callback for OAuth2AccessTokenFetcher on failure.
|
| void ProfileDownloader::OnGetTokenFailure(const GoogleServiceAuthError& error) {
|
| LOG(WARNING) << "ProfileDownloader: token request using refresh token failed";
|
| +
|
| + // TODO(vishwath): This can be removed when refactoring this class to use
|
| + // OAuth2TokenService instead.
|
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| + Profile* profile = delegate_->GetBrowserProfile();
|
| + DCHECK(profile);
|
| + AboutSigninInternalsFactory::GetForProfile(profile)->
|
| + NotifyTokenReceivedFailure(signin_internals_util::kProfileDownloaderToken,
|
| + error.ToString());
|
| delegate_->OnProfileDownloadFailure(
|
| this, ProfileDownloaderDelegate::TOKEN_ERROR);
|
| }
|
|
|