| Index: chrome/browser/policy/user_policy_signin_service.cc
|
| diff --git a/chrome/browser/policy/user_policy_signin_service.cc b/chrome/browser/policy/user_policy_signin_service.cc
|
| index a56644f5d577a1d5473050d92d025d7bd9ab1f91..1c0ec2172e0ef0857b8be17964e81d7e17e0577a 100644
|
| --- a/chrome/browser/policy/user_policy_signin_service.cc
|
| +++ b/chrome/browser/policy/user_policy_signin_service.cc
|
| @@ -12,6 +12,8 @@
|
| #include "chrome/browser/policy/user_cloud_policy_manager_factory.h"
|
| #include "chrome/browser/prefs/pref_service.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| +#include "chrome/browser/signin/about_signin_internals.h"
|
| +#include "chrome/browser/signin/about_signin_internals_factory.h"
|
| #include "chrome/browser/signin/signin_manager.h"
|
| #include "chrome/browser/signin/signin_manager_factory.h"
|
| #include "chrome/browser/signin/token_service.h"
|
| @@ -24,6 +26,8 @@
|
| #include "google_apis/gaia/gaia_urls.h"
|
| #include "google_apis/gaia/oauth2_access_token_fetcher.h"
|
|
|
| +using content::BrowserThread;
|
| +
|
| namespace {
|
| // Various OAuth service scopes required to do CloudPolicyClient registration.
|
| const char kServiceScopeChromeOSDeviceManagement[] =
|
| @@ -286,6 +290,14 @@ void UserPolicySigninService::OnGetTokenFailure(
|
| const GoogleServiceAuthError& error) {
|
| DLOG(WARNING) << "Could not fetch access token for "
|
| << kServiceScopeChromeOSDeviceManagement;
|
| +
|
| + // Let AboutSigninInternals know about the failed token fetch.
|
| + DCHECK(profile_);
|
| + AboutSigninInternalsFactory::GetForProfile(profile_)->
|
| + NotifyTokenReceivedFailure(
|
| + signin_internals_util::kUserPolicySigninServiceToken,
|
| + error.ToString());
|
| +
|
| oauth2_access_token_fetcher_.reset();
|
| // If there was a pending fetch request, let them know the fetch failed.
|
| NotifyPendingFetchCallback(false);
|
| @@ -295,7 +307,15 @@ void UserPolicySigninService::OnGetTokenSuccess(
|
| const std::string& access_token,
|
| const base::Time& expiration_time) {
|
| oauth_access_token_ = access_token;
|
| - DVLOG(1) << "Fetched new scoped OAuth token:" << oauth_access_token_;
|
| + DVLOG(1) << "Fetched new scoped OAuth token:" << access_token;
|
| +
|
| + DCHECK(profile_);
|
| + AboutSigninInternalsFactory::GetForProfile(profile_)->
|
| + NotifyTokenReceivedSuccess(
|
| + signin_internals_util::kUserPolicySigninServiceToken,
|
| + access_token,
|
| + true);
|
| +
|
| oauth2_access_token_fetcher_.reset();
|
| // Now we've gotten our access token - contact GAIA to see if this is a
|
| // hosted domain.
|
|
|