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

Unified Diff: ios/chrome/browser/signin/profile_oauth2_token_service_ios_provider_impl.mm

Issue 2442563002: Access SigninErrorProvider through ChromeBrowserProvider. (Closed)
Patch Set: Created 4 years, 2 months 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 | « no previous file | ios/chrome/browser/signin/signin_util.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | ios/chrome/browser/signin/signin_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698