OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "google_apis/gaia/oauth2_mint_token_flow.h" | 5 #include "google_apis/gaia/oauth2_mint_token_flow.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 std::string OAuth2MintTokenFlow::CreateApiCallBody() { | 133 std::string OAuth2MintTokenFlow::CreateApiCallBody() { |
134 const char* force_value = | 134 const char* force_value = |
135 (parameters_.mode == MODE_MINT_TOKEN_FORCE || | 135 (parameters_.mode == MODE_MINT_TOKEN_FORCE || |
136 parameters_.mode == MODE_RECORD_GRANT) | 136 parameters_.mode == MODE_RECORD_GRANT) |
137 ? kForceValueTrue : kForceValueFalse; | 137 ? kForceValueTrue : kForceValueFalse; |
138 const char* response_type_value = | 138 const char* response_type_value = |
139 (parameters_.mode == MODE_MINT_TOKEN_NO_FORCE || | 139 (parameters_.mode == MODE_MINT_TOKEN_NO_FORCE || |
140 parameters_.mode == MODE_MINT_TOKEN_FORCE) | 140 parameters_.mode == MODE_MINT_TOKEN_FORCE) |
141 ? kResponseTypeValueToken : kResponseTypeValueNone; | 141 ? kResponseTypeValueToken : kResponseTypeValueNone; |
142 return StringPrintf( | 142 return base::StringPrintf( |
143 kOAuth2IssueTokenBodyFormat, | 143 kOAuth2IssueTokenBodyFormat, |
144 net::EscapeUrlEncodedData(force_value, true).c_str(), | 144 net::EscapeUrlEncodedData(force_value, true).c_str(), |
145 net::EscapeUrlEncodedData(response_type_value, true).c_str(), | 145 net::EscapeUrlEncodedData(response_type_value, true).c_str(), |
146 net::EscapeUrlEncodedData( | 146 net::EscapeUrlEncodedData( |
147 JoinString(parameters_.scopes, ' '), true).c_str(), | 147 JoinString(parameters_.scopes, ' '), true).c_str(), |
148 net::EscapeUrlEncodedData(parameters_.client_id, true).c_str(), | 148 net::EscapeUrlEncodedData(parameters_.client_id, true).c_str(), |
149 net::EscapeUrlEncodedData(parameters_.extension_id, true).c_str()); | 149 net::EscapeUrlEncodedData(parameters_.extension_id, true).c_str()); |
150 } | 150 } |
151 | 151 |
152 void OAuth2MintTokenFlow::ProcessApiCallSuccess( | 152 void OAuth2MintTokenFlow::ProcessApiCallSuccess( |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 for (size_t i = 0; i < entry.details.size(); i++) | 239 for (size_t i = 0; i < entry.details.size(); i++) |
240 TrimWhitespace(entry.details[i], TRIM_ALL, &entry.details[i]); | 240 TrimWhitespace(entry.details[i], TRIM_ALL, &entry.details[i]); |
241 issue_advice->push_back(entry); | 241 issue_advice->push_back(entry); |
242 } | 242 } |
243 | 243 |
244 if (!success) | 244 if (!success) |
245 issue_advice->clear(); | 245 issue_advice->clear(); |
246 | 246 |
247 return success; | 247 return success; |
248 } | 248 } |
OLD | NEW |