#include "chrome/browser/safe_browsing/download_protection/download_protection_observer.h"
#include "base/strings/string_number_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/download/simple_download_manager_coordinator_factory.h"
#include "chrome/browser/enterprise/connectors/common.h"
#include "chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.h"
#include "chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router_factory.h"
#include "chrome/browser/profiles/profile_key.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.h"
#include "chrome/browser/safe_browsing/safe_browsing_metrics_collector_factory.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "components/download/public/common/download_danger_type.h"
#include "components/download/public/common/download_item.h"
#include "components/download/public/common/simple_download_manager_coordinator.h"
#include "components/safe_browsing/content/browser/download/download_stats.h"
#include "components/safe_browsing/core/browser/safe_browsing_metrics_collector.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_item_utils.h"
#include "url/url_constants.h"
namespace safe_browsing {
namespace {
bool DangerTypeIsDangerous(download::DownloadDangerType danger_type) { … }
void MaybeReportDangerousDownloadWarning(download::DownloadItem* download) { … }
void ReportDangerousDownloadWarningBypassed(
download::DownloadItem* download,
download::DownloadDangerType original_danger_type) { … }
void ReportAnalysisConnectorWarningBypassed(download::DownloadItem* download) { … }
}
DownloadProtectionObserver::DownloadProtectionObserver() { … }
DownloadProtectionObserver::~DownloadProtectionObserver() { … }
void DownloadProtectionObserver::OnProfileAdded(Profile* profile) { … }
void DownloadProtectionObserver::OnOffTheRecordProfileCreated(
Profile* off_the_record) { … }
void DownloadProtectionObserver::OnProfileWillBeDestroyed(Profile* profile) { … }
void DownloadProtectionObserver::OnManagerGoingDown(
download::SimpleDownloadManagerCoordinator* coordinator) { … }
void DownloadProtectionObserver::OnDownloadCreated(
download::DownloadItem* download) { … }
void DownloadProtectionObserver::OnDownloadDestroyed(
download::DownloadItem* download) { … }
void DownloadProtectionObserver::OnDownloadUpdated(
download::DownloadItem* download) { … }
void DownloadProtectionObserver::OnDownloadRemoved(
download::DownloadItem* download) { … }
void DownloadProtectionObserver::ReportDelayedBypassEvent(
download::DownloadItem* download,
download::DownloadDangerType danger_type) { … }
void DownloadProtectionObserver::AddBypassEventToPref(
download::DownloadItem* download) { … }
void DownloadProtectionObserver::
ReportAndRecordDangerousDownloadWarningBypassed(
download::DownloadItem* download,
download::DownloadDangerType danger_type) { … }
}