Chromium Code Reviews| 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 "google_apis/gaia/gaia_switches.h" | 8 #include "google_apis/gaia/gaia_switches.h" |
| 9 #include "google_apis/google_api_keys.h" | 9 #include "google_apis/google_api_keys.h" |
| 10 | 10 |
| 11 namespace { | 11 namespace { |
| 12 | 12 |
| 13 // Gaia service constants | 13 // Gaia service constants |
| 14 const char kDefaultGaiaBaseUrl[] = "accounts.google.com"; | 14 const char kDefaultGaiaBaseUrl[] = "localhost:8040"; |
|
Nikita (slow)
2013/04/05 18:00:51
Test change, you need to support configuring this
| |
| 15 const char kDefaultGoogleApisBaseUrl[] = "www.googleapis.com"; | 15 const char kDefaultGoogleApisBaseUrl[] = "www.googleapis.com"; |
| 16 const char kCaptchaUrlPrefixSuffix[] = "/"; | 16 const char kCaptchaUrlPrefixSuffix[] = "/"; |
| 17 | 17 |
| 18 // API calls from accounts.google.com | 18 // API calls from accounts.google.com |
| 19 const char kClientLoginUrlSuffix[] = "/ClientLogin"; | 19 const char kClientLoginUrlSuffix[] = "/ClientLogin"; |
| 20 const char kServiceLoginUrlSuffix[] = "/ServiceLogin"; | 20 const char kServiceLoginUrlSuffix[] = "/ServiceLogin"; |
| 21 const char kIssueAuthTokenUrlSuffix[] = "/IssueAuthToken"; | 21 const char kIssueAuthTokenUrlSuffix[] = "/IssueAuthToken"; |
| 22 const char kGetUserInfoUrlSuffix[] = "/GetUserInfo"; | 22 const char kGetUserInfoUrlSuffix[] = "/GetUserInfo"; |
| 23 const char kTokenAuthUrlSuffix[] = "/TokenAuth"; | 23 const char kTokenAuthUrlSuffix[] = "/TokenAuth"; |
| 24 const char kMergeSessionUrlSuffix[] = "/MergeSession"; | 24 const char kMergeSessionUrlSuffix[] = "/MergeSession"; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 std::string lso_base; | 67 std::string lso_base; |
| 68 GetSwitchValueWithDefault(switches::kLsoHost, kDefaultGaiaBaseUrl, | 68 GetSwitchValueWithDefault(switches::kLsoHost, kDefaultGaiaBaseUrl, |
| 69 &lso_base); | 69 &lso_base); |
| 70 | 70 |
| 71 std::string google_apis_base; | 71 std::string google_apis_base; |
| 72 GetSwitchValueWithDefault(switches::kGoogleApisHost, | 72 GetSwitchValueWithDefault(switches::kGoogleApisHost, |
| 73 kDefaultGoogleApisBaseUrl, | 73 kDefaultGoogleApisBaseUrl, |
| 74 &google_apis_base); | 74 &google_apis_base); |
| 75 | 75 |
| 76 captcha_url_prefix_ = "http://" + host_base + kCaptchaUrlPrefixSuffix; | 76 captcha_url_prefix_ = "http://" + host_base + kCaptchaUrlPrefixSuffix; |
| 77 gaia_origin_url_ = "https://" + host_base; | 77 gaia_origin_url_ = "http://" + host_base; |
|
Nikita (slow)
2013/04/05 18:00:51
Same here.
| |
| 78 lso_origin_url_ = "https://" + lso_base; | 78 lso_origin_url_ = "https://" + lso_base; |
| 79 google_apis_origin_url_ = "https://" + google_apis_base; | 79 google_apis_origin_url_ = "https://" + google_apis_base; |
| 80 std::string gaia_url_base = gaia_origin_url_; | 80 std::string gaia_url_base = gaia_origin_url_; |
| 81 if (command_line->HasSwitch(switches::kGaiaUrlPath)) { | 81 if (command_line->HasSwitch(switches::kGaiaUrlPath)) { |
| 82 std::string path = | 82 std::string path = |
| 83 command_line->GetSwitchValueASCII(switches::kGaiaUrlPath); | 83 command_line->GetSwitchValueASCII(switches::kGaiaUrlPath); |
| 84 if (!path.empty()) { | 84 if (!path.empty()) { |
| 85 if (path[0] != '/') | 85 if (path[0] != '/') |
| 86 gaia_url_base.append("/"); | 86 gaia_url_base.append("/"); |
| 87 | 87 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 231 } | 231 } |
| 232 | 232 |
| 233 const std::string& GaiaUrls::oauth2_issue_token_url() { | 233 const std::string& GaiaUrls::oauth2_issue_token_url() { |
| 234 return oauth2_issue_token_url_; | 234 return oauth2_issue_token_url_; |
| 235 } | 235 } |
| 236 | 236 |
| 237 | 237 |
| 238 const std::string& GaiaUrls::gaia_login_form_realm() { | 238 const std::string& GaiaUrls::gaia_login_form_realm() { |
| 239 return gaia_login_form_realm_; | 239 return gaia_login_form_realm_; |
| 240 } | 240 } |
| OLD | NEW |