| 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 "google_apis/gaia/gaia_switches.h" | 9 #include "google_apis/gaia/gaia_switches.h" |
| 10 #include "google_apis/google_api_keys.h" | 10 #include "google_apis/google_api_keys.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 // API calls from www.googleapis.com | 40 // API calls from www.googleapis.com |
| 41 const char kOAuth2IssueTokenUrlSuffix[] = "/oauth2/v2/IssueToken"; | 41 const char kOAuth2IssueTokenUrlSuffix[] = "/oauth2/v2/IssueToken"; |
| 42 const char kOAuth2TokenInfoUrlSuffix[] = "/oauth2/v2/tokeninfo"; | 42 const char kOAuth2TokenInfoUrlSuffix[] = "/oauth2/v2/tokeninfo"; |
| 43 const char kOAuthUserInfoUrlSuffix[] = "/oauth2/v1/userinfo"; | 43 const char kOAuthUserInfoUrlSuffix[] = "/oauth2/v1/userinfo"; |
| 44 const char kOAuthWrapBridgeUserInfoScopeUrlSuffix[] = "/auth/userinfo.email"; | 44 const char kOAuthWrapBridgeUserInfoScopeUrlSuffix[] = "/auth/userinfo.email"; |
| 45 | 45 |
| 46 const char kOAuth1LoginScope[] = | 46 const char kOAuth1LoginScope[] = |
| 47 "https://www.google.com/accounts/OAuthLogin"; | 47 "https://www.google.com/accounts/OAuthLogin"; |
| 48 | 48 |
| 49 void GetSwitchValueWithDefault(const char* switch_value, | 49 void GetSwitchValueWithDefault(const std::string& 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 CommandLine* command_line = 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 |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 return oauth2_token_info_url_; | 240 return oauth2_token_info_url_; |
| 241 } | 241 } |
| 242 | 242 |
| 243 const std::string& GaiaUrls::oauth2_revoke_url() const { | 243 const std::string& GaiaUrls::oauth2_revoke_url() const { |
| 244 return oauth2_revoke_url_; | 244 return oauth2_revoke_url_; |
| 245 } | 245 } |
| 246 | 246 |
| 247 const std::string& GaiaUrls::gaia_login_form_realm() const { | 247 const std::string& GaiaUrls::gaia_login_form_realm() const { |
| 248 return gaia_login_form_realm_; | 248 return gaia_login_form_realm_; |
| 249 } | 249 } |
| OLD | NEW |