#include "components/safe_browsing/content/browser/base_ui_manager.h"
#include <utility>
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/i18n/rtl.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_functions.h"
#include "components/safe_browsing/content/browser/async_check_tracker.h"
#include "components/safe_browsing/content/browser/base_blocking_page.h"
#include "components/safe_browsing/content/browser/unsafe_resource_util.h"
#include "components/safe_browsing/core/common/features.h"
#include "components/safe_browsing/core/common/scheme_logger.h"
#include "components/security_interstitials/content/security_interstitial_page.h"
#include "components/security_interstitials/content/security_interstitial_tab_helper.h"
#include "components/security_interstitials/core/unsafe_resource.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_user_data.h"
#include "services/network/public/mojom/fetch_api.mojom-shared.h"
BrowserThread;
NavigationEntry;
WebContents;
ClientSafeBrowsingReportRequest;
HitReport;
SBThreatType;
namespace …
namespace safe_browsing {
BaseUIManager::BaseUIManager() = default;
BaseUIManager::~BaseUIManager() = default;
bool BaseUIManager::IsAllowlisted(const UnsafeResource& resource) { … }
bool BaseUIManager::IsUrlAllowlistedOrPendingForWebContents(
const GURL& url,
NavigationEntry* entry,
WebContents* web_contents,
bool allowlist_only,
SBThreatType* threat_type) { … }
void BaseUIManager::OnBlockingPageDone(
const std::vector<UnsafeResource>& resources,
bool proceed,
WebContents* web_contents,
const GURL& main_frame_url,
bool showed_interstitial) { … }
void BaseUIManager::DisplayBlockingPage(const UnsafeResource& resource) { … }
void BaseUIManager::EnsureAllowlistCreated(WebContents* web_contents) { … }
void BaseUIManager::CreateAndSendHitReport(const UnsafeResource& resource) { … }
void BaseUIManager::CreateAndSendClientSafeBrowsingWarningShownReport(
const UnsafeResource& resource) { … }
security_interstitials::SecurityInterstitialPage*
BaseUIManager::CreateBlockingPage(
content::WebContents* contents,
const GURL& blocked_url,
const UnsafeResource& unsafe_resource,
bool forward_extension_event,
std::optional<base::TimeTicks> blocked_page_shown_timestamp) { … }
void BaseUIManager::MaybeReportSafeBrowsingHit(
std::unique_ptr<HitReport> hit_report,
content::WebContents* web_contents) { … }
void BaseUIManager::MaybeSendClientSafeBrowsingWarningShownReport(
std::unique_ptr<ClientSafeBrowsingReportRequest> report,
content::WebContents* web_contents) { … }
void BaseUIManager::SendThreatDetails(
content::BrowserContext* browser_context,
std::unique_ptr<ClientSafeBrowsingReportRequest> report) { … }
void BaseUIManager::AttachThreatDetailsAndLaunchSurvey(
content::BrowserContext* browser_context,
std::unique_ptr<ClientSafeBrowsingReportRequest> report) { … }
void BaseUIManager::AddToAllowlistUrlSet(
const GURL& allowlist_url,
const std::optional<int64_t> navigation_id,
WebContents* web_contents,
bool pending,
SBThreatType threat_type) { … }
const std::string BaseUIManager::app_locale() const { … }
history::HistoryService* BaseUIManager::history_service(
content::WebContents* web_contents) { … }
const GURL BaseUIManager::default_safe_page() const { … }
void BaseUIManager::AddUnsafeResource(
GURL url,
security_interstitials::UnsafeResource resource) { … }
bool BaseUIManager::PopUnsafeResourceForNavigation(
GURL url,
int64_t navigation_id,
security_interstitials::UnsafeResource* resource) { … }
ThreatSeverity BaseUIManager::GetSeverestThreatForNavigation(
content::NavigationHandle* handle,
security_interstitials::UnsafeResource& severest_resource) { … }
ThreatSeverity BaseUIManager::GetSeverestThreatForRedirectChain(
const std::vector<GURL>& redirect_chain,
int64_t navigation_id,
security_interstitials::UnsafeResource& severest_resource) { … }
void BaseUIManager::RemoveAllowlistUrlSet(
const GURL& allowlist_url,
const std::optional<int64_t> navigation_id,
WebContents* web_contents,
bool from_pending_only) { … }
}