chromium/components/safe_browsing/content/browser/base_blocking_page.cc

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

#include "components/safe_browsing/content/browser/base_blocking_page.h"

#include <memory>

#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/lazy_instance.h"
#include "base/strings/string_number_conversions.h"
#include "base/time/time.h"
#include "components/safe_browsing/content/browser/async_check_tracker.h"
#include "components/safe_browsing/content/browser/safe_browsing_controller_client.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/safe_browsing_prefs.h"
#include "components/safe_browsing/core/common/utils.h"
#include "components/security_interstitials/content/security_interstitial_controller_client.h"
#include "components/security_interstitials/content/settings_page_helper.h"
#include "components/security_interstitials/core/metrics_helper.h"
#include "components/security_interstitials/core/safe_browsing_loud_error_ui.h"
#include "components/security_interstitials/core/unsafe_resource.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"

WebContents;
BaseSafeBrowsingErrorUI;
SafeBrowsingLoudErrorUI;
SecurityInterstitialControllerClient;

namespace safe_browsing {

namespace {

// After a safe browsing interstitial where the user opted-in to the report
// but clicked "proceed anyway", we delay the call to
// ThreatDetails::FinishCollection() by this much time (in
// milliseconds).
const int64_t kThreatDetailsProceedDelayMilliSeconds =;

base::LazyInstance<BaseBlockingPage::UnsafeResourceMap>::Leaky
    g_unsafe_resource_map =;

}  // namespace

BaseBlockingPage::BaseBlockingPage(
    BaseUIManager* ui_manager,
    WebContents* web_contents,
    const GURL& main_frame_url,
    const UnsafeResourceList& unsafe_resources,
    std::unique_ptr<SecurityInterstitialControllerClient> controller_client,
    const BaseSafeBrowsingErrorUI::SBErrorDisplayOptions& display_options)
    :{}

BaseBlockingPage::~BaseBlockingPage() {}

// static
const security_interstitials::BaseSafeBrowsingErrorUI::SBErrorDisplayOptions
BaseBlockingPage::CreateDefaultDisplayOptions(
    const UnsafeResourceList& unsafe_resources) {}

// static
bool BaseBlockingPage::IsMainPageLoadPending(
    const UnsafeResourceList& unsafe_resources) {}

void BaseBlockingPage::SetThreatDetailsProceedDelayForTesting(int64_t delay) {}

void BaseBlockingPage::CommandReceived(const std::string& page_cmd) {}

void BaseBlockingPage::PopulateInterstitialStrings(
    base::Value::Dict& load_time_data) {}

void BaseBlockingPage::FinishThreatDetails(const base::TimeDelta& delay,
                                           bool did_proceed,
                                           int num_visits) {}

// static
BaseBlockingPage::UnsafeResourceMap* BaseBlockingPage::GetUnsafeResourcesMap() {}

// static
std::string BaseBlockingPage::GetMetricPrefix(
    const UnsafeResourceList& unsafe_resources,
    BaseSafeBrowsingErrorUI::SBInterstitialReason interstitial_reason) {}

// static
security_interstitials::BaseSafeBrowsingErrorUI::SBInterstitialReason
BaseBlockingPage::GetInterstitialReason(
    const UnsafeResourceList& unsafe_resources) {}

BaseUIManager* BaseBlockingPage::ui_manager() const {}

const GURL BaseBlockingPage::main_frame_url() const {}

BaseBlockingPage::UnsafeResourceList BaseBlockingPage::unsafe_resources()
    const {}

bool BaseBlockingPage::proceeded() const {}

int64_t BaseBlockingPage::threat_details_proceed_delay() const {}

BaseSafeBrowsingErrorUI* BaseBlockingPage::sb_error_ui() const {}

void BaseBlockingPage::set_proceeded(bool proceeded) {}

// static
security_interstitials::MetricsHelper::ReportDetails
BaseBlockingPage::GetReportingInfo(
    const UnsafeResourceList& unsafe_resources,
    std::optional<base::TimeTicks> blocked_page_shown_timestamp) {}

// static
std::unique_ptr<SecurityInterstitialControllerClient>
BaseBlockingPage::CreateControllerClient(
    content::WebContents* web_contents,
    const UnsafeResourceList& unsafe_resources,
    BaseUIManager* ui_manager,
    PrefService* pref_service,
    std::unique_ptr<security_interstitials::SettingsPageHelper>
        settings_page_helper,
    std::optional<base::TimeTicks> blocked_page_shown_timestamp) {}

int BaseBlockingPage::GetHTMLTemplateId() {}

void BaseBlockingPage::set_sb_error_ui(
    std::unique_ptr<BaseSafeBrowsingErrorUI> sb_error_ui) {}

void BaseBlockingPage::OnDontProceedDone() {}

// static
bool BaseBlockingPage::ShouldReportThreatDetails(SBThreatType threat_type) {}

}  // namespace safe_browsing