chromium/google_apis/gaia/gaia_urls.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// Gaia service constants
const char kDefaultGoogleUrl[] =;
const char kDefaultGaiaUrl[] =;
const char kDefaultGoogleApisBaseUrl[] =;
const char kDefaultOAuthAccountManagerBaseUrl[] =;
const char kDefaultAccountCapabilitiesBaseUrl[] =;
constexpr char kDefaultClassroomApiBaseUrl[] =;
constexpr char kDefaultTasksApiBaseUrl[] =;

// API calls from accounts.google.com
const char kEmbeddedSetupChromeOsUrlSuffix[] =;
const char kEmbeddedReauthChromeOsUrlSuffix[] =;
const char kEmbeddedSetupChromeOsKidSignupUrlSuffix[] =;
const char kEmbeddedSetupChromeOsKidSigninUrlSuffix[] =;
const char kEmbeddedSetupWindowsUrlSuffix[] =;
const char kSamlRedirectChromeOsUrlSuffix[] =;
// Parameter "ssp=1" is used to skip showing the password bubble when a user
// signs in to Chrome. Note that Gaia will pass this client specified parameter
// to all URLs that are loaded as part of thi sign-in flow.
const char kSigninChromeSyncDice[] =;
// Opens the "Verify it's you" reauth gaia page.
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
// Parameter "kdi" is used to distinguish recoverability management from
// retrieval. The value is a base64-encoded serialized protobuf, referred to
// internally as ClientDecryptableKeyDataInputs.
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[] =;

// API calls from accounts.google.com (LSO)
const char kOAuth2RevokeUrlSuffix[] =;

// API calls from www.googleapis.com
const char kOAuth2TokenUrlSuffix[] =;
const char kOAuth2TokenInfoUrlSuffix[] =;
const char kOAuthUserInfoUrlSuffix[] =;
const char kReAuthApiUrlSuffix[] =;

// API calls from oauthaccountmanager.googleapis.com
const char kOAuth2IssueTokenUrlSuffix[] =;

// API calls from accountcapabilities-pa.googleapis.com
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) {}

}  // namespace

GaiaUrls* GaiaUrls::GetInstance() {}

GaiaUrls::GaiaUrls() {}

GaiaUrls::~GaiaUrls() = default;

// static
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() {}