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

Side by Side Diff: google_apis/gaia/oauth2_access_token_fetcher_impl.cc

Issue 1223153003: Move JoinString to the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: windows Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « google_apis/gaia/gaia_oauth_client.cc ('k') | google_apis/gaia/oauth2_mint_token_flow.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_access_token_fetcher_impl.h" 5 #include "google_apis/gaia/oauth2_access_token_fetcher_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 std::string enc_client_secret = 276 std::string enc_client_secret =
277 net::EscapeUrlEncodedData(client_secret, true); 277 net::EscapeUrlEncodedData(client_secret, true);
278 std::string enc_refresh_token = 278 std::string enc_refresh_token =
279 net::EscapeUrlEncodedData(refresh_token, true); 279 net::EscapeUrlEncodedData(refresh_token, true);
280 if (scopes.empty()) { 280 if (scopes.empty()) {
281 return base::StringPrintf(kGetAccessTokenBodyFormat, 281 return base::StringPrintf(kGetAccessTokenBodyFormat,
282 enc_client_id.c_str(), 282 enc_client_id.c_str(),
283 enc_client_secret.c_str(), 283 enc_client_secret.c_str(),
284 enc_refresh_token.c_str()); 284 enc_refresh_token.c_str());
285 } else { 285 } else {
286 std::string scopes_string = JoinString(scopes, ' '); 286 std::string scopes_string = base::JoinString(scopes, " ");
287 return base::StringPrintf( 287 return base::StringPrintf(
288 kGetAccessTokenBodyWithScopeFormat, 288 kGetAccessTokenBodyWithScopeFormat,
289 enc_client_id.c_str(), 289 enc_client_id.c_str(),
290 enc_client_secret.c_str(), 290 enc_client_secret.c_str(),
291 enc_refresh_token.c_str(), 291 enc_refresh_token.c_str(),
292 net::EscapeUrlEncodedData(scopes_string, true).c_str()); 292 net::EscapeUrlEncodedData(scopes_string, true).c_str());
293 } 293 }
294 } 294 }
295 295
296 // static 296 // static
(...skipping 13 matching lines...) Expand all
310 // static 310 // static
311 bool OAuth2AccessTokenFetcherImpl::ParseGetAccessTokenFailureResponse( 311 bool OAuth2AccessTokenFetcherImpl::ParseGetAccessTokenFailureResponse(
312 const net::URLFetcher* source, 312 const net::URLFetcher* source,
313 std::string* error) { 313 std::string* error) {
314 CHECK(error); 314 CHECK(error);
315 scoped_ptr<base::DictionaryValue> value = ParseGetAccessTokenResponse(source); 315 scoped_ptr<base::DictionaryValue> value = ParseGetAccessTokenResponse(source);
316 if (value.get() == NULL) 316 if (value.get() == NULL)
317 return false; 317 return false;
318 return value->GetString(kErrorKey, error); 318 return value->GetString(kErrorKey, error);
319 } 319 }
OLDNEW
« no previous file with comments | « google_apis/gaia/gaia_oauth_client.cc ('k') | google_apis/gaia/oauth2_mint_token_flow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698