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/gaia_urls.h" | 5 #include "google_apis/gaia/gaia_urls.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "google_apis/gaia/gaia_switches.h" | 10 #include "google_apis/gaia/gaia_switches.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 const char kOAuth2TokenUrlSuffix[] = "o/oauth2/token"; | 42 const char kOAuth2TokenUrlSuffix[] = "o/oauth2/token"; |
43 | 43 |
44 // API calls from www.googleapis.com | 44 // API calls from www.googleapis.com |
45 const char kOAuth2IssueTokenUrlSuffix[] = "oauth2/v2/IssueToken"; | 45 const char kOAuth2IssueTokenUrlSuffix[] = "oauth2/v2/IssueToken"; |
46 const char kOAuth2TokenInfoUrlSuffix[] = "oauth2/v2/tokeninfo"; | 46 const char kOAuth2TokenInfoUrlSuffix[] = "oauth2/v2/tokeninfo"; |
47 const char kOAuthUserInfoUrlSuffix[] = "oauth2/v1/userinfo"; | 47 const char kOAuthUserInfoUrlSuffix[] = "oauth2/v1/userinfo"; |
48 | 48 |
49 void GetSwitchValueWithDefault(const char* switch_value, | 49 void GetSwitchValueWithDefault(const char* switch_value, |
50 const char* default_value, | 50 const char* default_value, |
51 std::string* output_value) { | 51 std::string* output_value) { |
52 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 52 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
53 if (command_line->HasSwitch(switch_value)) { | 53 if (command_line->HasSwitch(switch_value)) { |
54 *output_value = command_line->GetSwitchValueASCII(switch_value); | 54 *output_value = command_line->GetSwitchValueASCII(switch_value); |
55 } else { | 55 } else { |
56 *output_value = default_value; | 56 *output_value = default_value; |
57 } | 57 } |
58 } | 58 } |
59 | 59 |
60 GURL GetURLSwitchValueWithDefault(const char* switch_value, | 60 GURL GetURLSwitchValueWithDefault(const char* switch_value, |
61 const char* default_value) { | 61 const char* default_value) { |
62 std::string string_value; | 62 std::string string_value; |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 base::StringPrintf("?source=%s&%s", source.c_str(), query.c_str())); | 248 base::StringPrintf("?source=%s&%s", source.c_str(), query.c_str())); |
249 } | 249 } |
250 } | 250 } |
251 | 251 |
252 GURL GaiaUrls::GetCheckConnectionInfoURLWithSource(const std::string& source) { | 252 GURL GaiaUrls::GetCheckConnectionInfoURLWithSource(const std::string& source) { |
253 return source.empty() | 253 return source.empty() |
254 ? get_check_connection_info_url_ | 254 ? get_check_connection_info_url_ |
255 : get_check_connection_info_url_.Resolve( | 255 : get_check_connection_info_url_.Resolve( |
256 base::StringPrintf("?source=%s", source.c_str())); | 256 base::StringPrintf("?source=%s", source.c_str())); |
257 } | 257 } |
OLD | NEW |