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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 ? kForceValueTrue : kForceValueFalse; | 160 ? kForceValueTrue : kForceValueFalse; |
161 const char* response_type_value = | 161 const char* response_type_value = |
162 (parameters_.mode == MODE_MINT_TOKEN_NO_FORCE || | 162 (parameters_.mode == MODE_MINT_TOKEN_NO_FORCE || |
163 parameters_.mode == MODE_MINT_TOKEN_FORCE) | 163 parameters_.mode == MODE_MINT_TOKEN_FORCE) |
164 ? kResponseTypeValueToken : kResponseTypeValueNone; | 164 ? kResponseTypeValueToken : kResponseTypeValueNone; |
165 std::string body = base::StringPrintf( | 165 std::string body = base::StringPrintf( |
166 kOAuth2IssueTokenBodyFormat, | 166 kOAuth2IssueTokenBodyFormat, |
167 net::EscapeUrlEncodedData(force_value, true).c_str(), | 167 net::EscapeUrlEncodedData(force_value, true).c_str(), |
168 net::EscapeUrlEncodedData(response_type_value, true).c_str(), | 168 net::EscapeUrlEncodedData(response_type_value, true).c_str(), |
169 net::EscapeUrlEncodedData( | 169 net::EscapeUrlEncodedData( |
170 JoinString(parameters_.scopes, ' '), true).c_str(), | 170 base::JoinString(parameters_.scopes, " "), true).c_str(), |
171 net::EscapeUrlEncodedData(parameters_.client_id, true).c_str(), | 171 net::EscapeUrlEncodedData(parameters_.client_id, true).c_str(), |
172 net::EscapeUrlEncodedData(parameters_.extension_id, true).c_str()); | 172 net::EscapeUrlEncodedData(parameters_.extension_id, true).c_str()); |
173 if (!parameters_.device_id.empty()) { | 173 if (!parameters_.device_id.empty()) { |
174 body.append(base::StringPrintf( | 174 body.append(base::StringPrintf( |
175 kOAuth2IssueTokenBodyFormatDeviceIdAddendum, | 175 kOAuth2IssueTokenBodyFormatDeviceIdAddendum, |
176 net::EscapeUrlEncodedData(parameters_.device_id, true).c_str())); | 176 net::EscapeUrlEncodedData(parameters_.device_id, true).c_str())); |
177 } | 177 } |
178 return body; | 178 return body; |
179 } | 179 } |
180 | 180 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 detail, base::ASCIIToUTF16(kDetailSeparators), | 267 detail, base::ASCIIToUTF16(kDetailSeparators), |
268 base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); | 268 base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); |
269 issue_advice->push_back(entry); | 269 issue_advice->push_back(entry); |
270 } | 270 } |
271 | 271 |
272 if (!success) | 272 if (!success) |
273 issue_advice->clear(); | 273 issue_advice->clear(); |
274 | 274 |
275 return success; | 275 return success; |
276 } | 276 } |
OLD | NEW |