chromium/components/safe_browsing/content/browser/safe_browsing_blocking_page.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.
//
// Implementation of the SafeBrowsingBlockingPage class.

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

#include <memory>

#include "base/feature_list.h"
#include "base/lazy_instance.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "components/prefs/pref_service.h"
#include "components/safe_browsing/content/browser/client_report_util.h"
#include "components/safe_browsing/content/browser/safe_browsing_navigation_observer_manager.h"
#include "components/safe_browsing/content/browser/threat_details.h"
#include "components/safe_browsing/content/browser/triggers/trigger_manager.h"
#include "components/safe_browsing/content/browser/unsafe_resource_util.h"
#include "components/safe_browsing/content/browser/web_contents_key.h"
#include "components/safe_browsing/core/browser/safe_browsing_hats_delegate.h"
#include "components/safe_browsing/core/browser/safe_browsing_metrics_collector.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/controller_client.h"
#include "components/security_interstitials/core/safe_browsing_loud_error_ui.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/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_recorder.h"
#include "services/metrics/public/cpp/ukm_source_id.h"

BrowserThread;
WebContents;
BaseSafeBrowsingErrorUI;
SecurityInterstitialControllerClient;

namespace safe_browsing {

// static
const security_interstitials::SecurityInterstitialPage::TypeID
    SafeBrowsingBlockingPage::kTypeForTesting =;

SafeBrowsingBlockingPage::SafeBrowsingBlockingPage(
    BaseUIManager* ui_manager,
    WebContents* web_contents,
    const GURL& main_frame_url,
    const UnsafeResourceList& unsafe_resources,
    std::unique_ptr<
        security_interstitials::SecurityInterstitialControllerClient>
        controller_client,
    const BaseSafeBrowsingErrorUI::SBErrorDisplayOptions& display_options,
    bool should_trigger_reporting,
    history::HistoryService* history_service,
    SafeBrowsingNavigationObserverManager* navigation_observer_manager,
    SafeBrowsingMetricsCollector* metrics_collector,
    TriggerManager* trigger_manager,
    bool is_proceed_anyway_disabled,
    bool is_safe_browsing_surveys_enabled,
    base::OnceCallback<void(bool, SBThreatType)>
        trust_safety_sentiment_service_trigger,
    base::OnceCallback<void(bool, SBThreatType)>
        ignore_auto_revocation_notifications_trigger,
    network::SharedURLLoaderFactory* url_loader_for_testing)
    :{}

SafeBrowsingBlockingPage::~SafeBrowsingBlockingPage() {}

security_interstitials::SecurityInterstitialPage::TypeID
SafeBrowsingBlockingPage::GetTypeForTesting() {}

void SafeBrowsingBlockingPage::OnInterstitialClosing() {}

void SafeBrowsingBlockingPage::SendFallbackReport(
    const security_interstitials::UnsafeResource resource,
    bool did_proceed,
    int num_visits,
    security_interstitials::InterstitialInteractionMap* interactions,
    bool is_hats_candidate) {}

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

void SafeBrowsingBlockingPage::LogSafeBrowsingInterstitialBypassedUKM(
    content::WebContents* web_contents) {}

void SafeBrowsingBlockingPage::LogSafeBrowsingInterstitialShownUKM(
    content::WebContents* web_contents) {}

}  // namespace safe_browsing