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

Unified Diff: google_apis/gaia/oauth2_api_call_flow.cc

Issue 475483003: Wire easy unlock settings UI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 4 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 | « google_apis/gaia/oauth2_api_call_flow.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gaia/oauth2_api_call_flow.cc
diff --git a/google_apis/gaia/oauth2_api_call_flow.cc b/google_apis/gaia/oauth2_api_call_flow.cc
index 08312ebe5d39ca65024b67b060a04c4910300ef7..07f32082817f34f6981a95577e9e2c4575ad63fb 100644
--- a/google_apis/gaia/oauth2_api_call_flow.cc
+++ b/google_apis/gaia/oauth2_api_call_flow.cc
@@ -90,7 +90,8 @@ void OAuth2ApiCallFlow::EndApiCall(const net::URLFetcher* source) {
return;
}
- if (source->GetResponseCode() != net::HTTP_OK) {
+ if (source->GetResponseCode() != net::HTTP_OK &&
+ source->GetResponseCode() != net::HTTP_NO_CONTENT) {
state_ = ERROR_STATE;
ProcessApiCallFailure(source);
return;
@@ -125,6 +126,10 @@ void OAuth2ApiCallFlow::EndMintAccessToken(
}
}
+std::string OAuth2ApiCallFlow::CreateApiCallBodyContentType() {
+ return "application/x-www-form-urlencoded";
+}
+
OAuth2AccessTokenFetcher* OAuth2ApiCallFlow::CreateAccessTokenFetcher() {
return new OAuth2AccessTokenFetcherImpl(this, context_, refresh_token_);
}
@@ -166,7 +171,7 @@ URLFetcher* OAuth2ApiCallFlow::CreateURLFetcher() {
result->SetAutomaticallyRetryOnNetworkChanges(3);
if (!empty_body)
- result->SetUploadData("application/x-www-form-urlencoded", body);
+ result->SetUploadData(CreateApiCallBodyContentType(), body);
return result;
}
« no previous file with comments | « google_apis/gaia/oauth2_api_call_flow.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698