Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(462)

Unified Diff: chrome/browser/profiles/profile_downloader.cc

Issue 11618024: [signin] Support for CrOS and OAuth2AccessTokenConsumer services. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Minor fixes Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/policy/user_policy_signin_service.cc ('k') | chrome/browser/signin/signin_internals_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « chrome/browser/policy/user_policy_signin_service.cc ('k') | chrome/browser/signin/signin_internals_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698