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 "google_apis/gaia/gaia_switches.h" | 10 #include "google_apis/gaia/gaia_switches.h" |
10 #include "google_apis/google_api_keys.h" | 11 #include "google_apis/google_api_keys.h" |
11 | 12 |
12 namespace { | 13 namespace { |
13 | 14 |
14 // Gaia service constants | 15 // Gaia service constants |
15 const char kDefaultGaiaUrl[] = "https://accounts.google.com"; | 16 const char kDefaultGaiaUrl[] = "https://accounts.google.com"; |
16 const char kDefaultGoogleApisBaseUrl[] = "https://www.googleapis.com"; | 17 const char kDefaultGoogleApisBaseUrl[] = "https://www.googleapis.com"; |
17 | 18 |
18 // API calls from accounts.google.com | 19 // API calls from accounts.google.com |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 return oauth2_token_info_url_; | 239 return oauth2_token_info_url_; |
239 } | 240 } |
240 | 241 |
241 const GURL& GaiaUrls::oauth2_revoke_url() const { | 242 const GURL& GaiaUrls::oauth2_revoke_url() const { |
242 return oauth2_revoke_url_; | 243 return oauth2_revoke_url_; |
243 } | 244 } |
244 | 245 |
245 const GURL& GaiaUrls::gaia_login_form_realm() const { | 246 const GURL& GaiaUrls::gaia_login_form_realm() const { |
246 return gaia_url_; | 247 return gaia_url_; |
247 } | 248 } |
| 249 |
| 250 GURL GaiaUrls::ListAccountsURLWithSource(const std::string& source) { |
| 251 if (source.empty()) { |
| 252 return list_accounts_url(); |
| 253 } else { |
| 254 std::string query = list_accounts_url().query(); |
| 255 return list_accounts_url().Resolve( |
| 256 base::StringPrintf("?source=%s&%s", source.c_str(), query.c_str())); |
| 257 } |
| 258 } |
| 259 |
| 260 GURL GaiaUrls::GetCheckConnectionInfoURLWithSource(const std::string& source) { |
| 261 return source.empty() |
| 262 ? get_check_connection_info_url() |
| 263 : get_check_connection_info_url().Resolve( |
| 264 base::StringPrintf("?source=%s", source.c_str())); |
| 265 } |
OLD | NEW |