| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/common/net/gaia/gaia_urls.h" | 5 #include "chrome/common/net/gaia/gaia_urls.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
| 9 | 9 |
| 10 namespace { | 10 namespace { |
| 11 | 11 |
| 12 const char kDefaultGaiaBaseUrl[] = "www.google.com"; | 12 const char kDefaultGaiaBaseUrl[] = "www.google.com"; |
| 13 const char kCaptchaUrlPrefixSuffix[] = "/accounts/"; | 13 const char kCaptchaUrlPrefixSuffix[] = "/accounts/"; |
| 14 const char kClientLoginUrlSuffix[] = "/accounts/ClientLogin"; | 14 const char kClientLoginUrlSuffix[] = "/accounts/ClientLogin"; |
| 15 const char kIssueAuthTokenUrlSuffix[] = "/accounts/IssueAuthToken"; | 15 const char kIssueAuthTokenUrlSuffix[] = "/accounts/IssueAuthToken"; |
| 16 const char kGetUserInfoUrlSuffix[] = "/accounts/GetUserInfo"; | 16 const char kGetUserInfoUrlSuffix[] = "/accounts/GetUserInfo"; |
| 17 // TODO(cmasone): make sure that using an http:// URL in the "continue" | 17 const char kTokenAuthUrlSuffix[] = "/accounts/TokenAuth"; |
| 18 // parameter here doesn't open the system up to attack long-term. | |
| 19 const char kTokenAuthUrlSuffix[] = | |
| 20 "/accounts/TokenAuth?" | |
| 21 "continue=http://www.google.com/webhp&source=chromeos&auth="; | |
| 22 | 18 |
| 23 } // namespacce | 19 } // namespacce |
| 24 | 20 |
| 25 GaiaUrls* GaiaUrls::GetInstance() { | 21 GaiaUrls* GaiaUrls::GetInstance() { |
| 26 return Singleton<GaiaUrls>::get(); | 22 return Singleton<GaiaUrls>::get(); |
| 27 } | 23 } |
| 28 | 24 |
| 29 GaiaUrls::GaiaUrls() { | 25 GaiaUrls::GaiaUrls() { |
| 30 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 26 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 31 if (command_line->HasSwitch(switches::kGaiaHost)) { | 27 if (command_line->HasSwitch(switches::kGaiaHost)) { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 56 return issue_auth_token_url_; | 52 return issue_auth_token_url_; |
| 57 } | 53 } |
| 58 | 54 |
| 59 const std::string& GaiaUrls::get_user_info_url() { | 55 const std::string& GaiaUrls::get_user_info_url() { |
| 60 return get_user_info_url_; | 56 return get_user_info_url_; |
| 61 } | 57 } |
| 62 | 58 |
| 63 const std::string& GaiaUrls::token_auth_url() { | 59 const std::string& GaiaUrls::token_auth_url() { |
| 64 return token_auth_url_; | 60 return token_auth_url_; |
| 65 } | 61 } |
| OLD | NEW |