#include "google_apis/gaia/gaia_urls.h"
#include <string_view>
#include "base/command_line.h"
#include "base/logging.h"
#include "base/macros/concat.h"
#include "base/strings/strcat.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "google_apis/gaia/gaia_config.h"
#include "google_apis/gaia/gaia_switches.h"
#include "google_apis/google_api_keys.h"
#include "url/url_canon.h"
#include "url/url_constants.h"
#define URL_KEY_AND_PTR(name) …
namespace {
const char kDefaultGoogleUrl[] = …;
const char kDefaultGaiaUrl[] = …;
const char kDefaultGoogleApisBaseUrl[] = …;
const char kDefaultOAuthAccountManagerBaseUrl[] = …;
const char kDefaultAccountCapabilitiesBaseUrl[] = …;
constexpr char kDefaultClassroomApiBaseUrl[] = …;
constexpr char kDefaultTasksApiBaseUrl[] = …;
const char kEmbeddedSetupChromeOsUrlSuffix[] = …;
const char kEmbeddedReauthChromeOsUrlSuffix[] = …;
const char kEmbeddedSetupChromeOsKidSignupUrlSuffix[] = …;
const char kEmbeddedSetupChromeOsKidSigninUrlSuffix[] = …;
const char kEmbeddedSetupWindowsUrlSuffix[] = …;
const char kSamlRedirectChromeOsUrlSuffix[] = …;
const char kSigninChromeSyncDice[] = …;
const char kAccountChooser[] = …;
#if BUILDFLAG(IS_ANDROID)
const char kSigninChromeSyncKeysRetrievalUrl[] = "encryption/unlock/android";
#elif BUILDFLAG(IS_IOS)
const char kSigninChromeSyncKeysRetrievalUrl[] = "encryption/unlock/ios";
#elif BUILDFLAG(IS_CHROMEOS)
const char kSigninChromeSyncKeysRetrievalUrl[] = "encryption/unlock/chromeos";
#else
const char kSigninChromeSyncKeysRetrievalUrl[] = …;
#endif
const char kSigninChromeSyncKeysRecoverabilityUrlSuffix[] = …;
const char kServiceLogoutUrlSuffix[] = …;
const char kBlankPageSuffix[] = …;
const char kOAuthMultiloginSuffix[] = …;
const char kListAccountsSuffix[] = …;
const char kEmbeddedSigninSuffix[] = …;
const char kAddAccountSuffix[] = …;
const char kReauthSuffix[] = …;
const char kGetCheckConnectionInfoSuffix[] = …;
const char kOAuth2RevokeUrlSuffix[] = …;
const char kOAuth2TokenUrlSuffix[] = …;
const char kOAuth2TokenInfoUrlSuffix[] = …;
const char kOAuthUserInfoUrlSuffix[] = …;
const char kReAuthApiUrlSuffix[] = …;
const char kOAuth2IssueTokenUrlSuffix[] = …;
const char kAccountCapabilitiesBatchGetUrlSuffix[] = …;
const char kRotateBoundCookiesUrlSuffix[] = …;
GaiaUrls* g_instance_for_testing = …;
void GetSwitchValueWithDefault(std::string_view switch_value,
std::string_view default_value,
std::string* output_value) { … }
GURL GetURLSwitchValueWithDefault(std::string_view switch_value,
std::string_view default_value) { … }
url::Origin GetOriginSwitchValueWithDefault(std::string_view switch_value,
std::string_view default_value) { … }
void SetDefaultURLIfInvalid(GURL* url_to_set,
std::string_view switch_value,
std::string_view default_value) { … }
void SetDefaultOriginIfOpaqueOrInvalidScheme(url::Origin* origin_to_set,
std::string_view switch_value,
std::string_view default_value) { … }
void ResolveURLIfInvalid(GURL* url_to_set,
const GURL& base_url,
std::string_view suffix) { … }
}
GaiaUrls* GaiaUrls::GetInstance() { … }
GaiaUrls::GaiaUrls() { … }
GaiaUrls::~GaiaUrls() = default;
void GaiaUrls::SetInstanceForTesting(GaiaUrls* gaia_urls) { … }
const GURL& GaiaUrls::google_url() const { … }
const GURL& GaiaUrls::secure_google_url() const { … }
const url::Origin& GaiaUrls::gaia_origin() const { … }
GURL GaiaUrls::gaia_url() const { … }
const GURL& GaiaUrls::embedded_setup_chromeos_url() const { … }
const GURL& GaiaUrls::embedded_setup_chromeos_kid_signup_url() const { … }
const GURL& GaiaUrls::embedded_setup_chromeos_kid_signin_url() const { … }
const GURL& GaiaUrls::embedded_setup_windows_url() const { … }
const GURL& GaiaUrls::embedded_reauth_chromeos_url() const { … }
const GURL& GaiaUrls::saml_redirect_chromeos_url() const { … }
const GURL& GaiaUrls::signin_chrome_sync_dice() const { … }
const GURL& GaiaUrls::reauth_chrome_dice() const { … }
const GURL& GaiaUrls::signin_chrome_sync_keys_retrieval_url() const { … }
const GURL& GaiaUrls::signin_chrome_sync_keys_recoverability_degraded_url()
const { … }
const GURL& GaiaUrls::service_logout_url() const { … }
const GURL& GaiaUrls::oauth_multilogin_url() const { … }
const GURL& GaiaUrls::oauth_user_info_url() const { … }
const GURL& GaiaUrls::embedded_signin_url() const { … }
const GURL& GaiaUrls::add_account_url() const { … }
const GURL& GaiaUrls::reauth_url() const { … }
const GURL& GaiaUrls::account_capabilities_url() const { … }
const std::string& GaiaUrls::oauth2_chrome_client_id() const { … }
const std::string& GaiaUrls::oauth2_chrome_client_secret() const { … }
const GURL& GaiaUrls::oauth2_token_url() const { … }
const GURL& GaiaUrls::oauth2_issue_token_url() const { … }
const GURL& GaiaUrls::oauth2_token_info_url() const { … }
const GURL& GaiaUrls::oauth2_revoke_url() const { … }
const GURL& GaiaUrls::reauth_api_url() const { … }
const GURL& GaiaUrls::rotate_bound_cookies_url() const { … }
const GURL& GaiaUrls::classroom_api_origin_url() const { … }
const GURL& GaiaUrls::tasks_api_origin_url() const { … }
const GURL& GaiaUrls::blank_page_url() const { … }
const GURL& GaiaUrls::google_apis_origin_url() const { … }
GURL GaiaUrls::ListAccountsURLWithSource(const std::string& source) { … }
GURL GaiaUrls::LogOutURLWithSource(const std::string& source) { … }
GURL GaiaUrls::GetCheckConnectionInfoURLWithSource(const std::string& source) { … }
GURL GaiaUrls::LogOutURLWithContinueURL(const GURL& continue_url) { … }
void GaiaUrls::InitializeDefault() { … }
void GaiaUrls::InitializeFromConfig() { … }