#include "content/browser/webid/webid_utils.h"
#include "base/rand_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "components/url_formatter/elide_url.h"
#include "components/url_formatter/url_formatter.h"
#include "content/browser/renderer_host/frame_tree_node.h"
#include "content/browser/webid/fedcm_metrics.h"
#include "content/browser/webid/federated_auth_request_page_data.h"
#include "content/browser/webid/flags.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/federated_identity_api_permission_context_delegate.h"
#include "content/public/browser/federated_identity_permission_context_delegate.h"
#include "content/public/browser/runtime_feature_state/runtime_feature_state_document_data.h"
#include "content/public/common/web_identity.h"
#include "net/base/net_errors.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "net/base/schemeful_site.h"
#include "net/base/url_util.h"
#include "third_party/blink/public/mojom/devtools/inspector_issue.mojom.h"
#include "third_party/blink/public/mojom/webid/federated_auth_request.mojom.h"
#include "url/origin.h"
FederatedAuthRequestResult;
FedCmDisconnectStatus;
namespace content::webid {
namespace {
constexpr net::registry_controlled_domains::PrivateRegistryFilter
kDefaultPrivateRegistryFilter = …;
}
bool IsSameSiteWithAncestors(const url::Origin& origin,
RenderFrameHost* render_frame_host) { … }
void SetIdpSigninStatus(content::BrowserContext* context,
int frame_tree_node_id,
const url::Origin& origin,
blink::mojom::IdpSigninStatus status) { … }
std::optional<std::string> ComputeConsoleMessageForHttpResponseCode(
const char* endpoint_name,
int http_response_code) { … }
bool IsEndpointSameOrigin(const GURL& identity_provider_config_url,
const GURL& endpoint_url) { … }
bool IsSameSite(const url::Origin& origin1, const url::Origin& origin2) { … }
bool ShouldFailAccountsEndpointRequestBecauseNotSignedInWithIdp(
RenderFrameHost& host,
const GURL& identity_provider_config_url,
FederatedIdentityPermissionContextDelegate* permission_delegate) { … }
void UpdateIdpSigninStatusForAccountsEndpointResponse(
RenderFrameHost& host,
const GURL& identity_provider_config_url,
IdpNetworkRequestManager::FetchStatus fetch_status,
bool does_idp_have_failing_signin_status,
FederatedIdentityPermissionContextDelegate* permission_delegate) { … }
std::string GetConsoleErrorMessageFromResult(
FederatedAuthRequestResult status) { … }
std::string GetDisconnectConsoleErrorMessage(
FedCmDisconnectStatus disconnect_status_for_metrics) { … }
FedCmIdpSigninStatusMode GetIdpSigninStatusMode(RenderFrameHost& host,
const url::Origin& idp_origin) { … }
std::string FormatUrlForDisplay(const GURL& url) { … }
bool HasSharingPermissionOrIdpHasThirdPartyCookiesAccess(
RenderFrameHost& host,
const GURL& provider_url,
const url::Origin& embedder_origin,
const url::Origin& requester_origin,
const std::optional<std::string>& account_id,
FederatedIdentityPermissionContextDelegate* sharing_permission_delegate,
FederatedIdentityApiPermissionContextDelegate* api_permission_delegate) { … }
bool IsFedCmAuthzEnabled(RenderFrameHost& host, const url::Origin& idp_origin) { … }
FederatedAuthRequestPageData* GetPageData(Page& page) { … }
int GetNewSessionID() { … }
}