| Index: ios/chrome/browser/signin/profile_oauth2_token_service_ios_provider_impl.mm
|
| diff --git a/ios/chrome/browser/signin/profile_oauth2_token_service_ios_provider_impl.mm b/ios/chrome/browser/signin/profile_oauth2_token_service_ios_provider_impl.mm
|
| index a288ebb5ce8be52a7b546719c08e438045450edf..f83189b596553cf4aac341b174d0850fd279c2b3 100644
|
| --- a/ios/chrome/browser/signin/profile_oauth2_token_service_ios_provider_impl.mm
|
| +++ b/ios/chrome/browser/signin/profile_oauth2_token_service_ios_provider_impl.mm
|
| @@ -80,24 +80,23 @@ ProfileOAuth2TokenServiceIOSProviderImpl::GetAuthenticationErrorCategory(
|
| return kAuthenticationErrorCategoryAuthorizationErrors;
|
| }
|
|
|
| - ios::SigninErrorCategory error_category =
|
| - ios::GetSigninErrorProvider()->GetErrorCategory(error);
|
| - switch (error_category) {
|
| + ios::SigninErrorProvider* provider =
|
| + ios::GetChromeBrowserProvider()->GetSigninErrorProvider();
|
| + switch (provider->GetErrorCategory(error)) {
|
| case ios::SigninErrorCategory::UNKNOWN_ERROR: {
|
| // Google's OAuth 2 implementation returns a 400 with JSON body
|
| // containing error key "invalid_grant" to indicate the refresh token
|
| // is invalid or has been revoked by the user.
|
| // Check that the underlying library does not categorize these errors as
|
| // unknown.
|
| - NSString* json_error_key =
|
| - ios::GetSigninErrorProvider()->GetInvalidGrantJsonErrorKey();
|
| - DCHECK(!ios::GetSigninErrorProvider()->IsBadRequest(error) ||
|
| + NSString* json_error_key = provider->GetInvalidGrantJsonErrorKey();
|
| + DCHECK(!provider->IsBadRequest(error) ||
|
| ![[[error userInfo] valueForKeyPath:@"json.error"]
|
| isEqual:json_error_key]);
|
| return kAuthenticationErrorCategoryUnknownErrors;
|
| }
|
| case ios::SigninErrorCategory::AUTHORIZATION_ERROR:
|
| - if (ios::GetSigninErrorProvider()->IsForbidden(error)) {
|
| + if (provider->IsForbidden(error)) {
|
| return kAuthenticationErrorCategoryAuthorizationForbiddenErrors;
|
| }
|
| return kAuthenticationErrorCategoryAuthorizationErrors;
|
|
|