#include "chrome/browser/safe_browsing/services_delegate_desktop.h"
#include <utility>
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/strings/string_util.h"
#include "chrome/browser/metrics/chrome_metrics_service_accessor.h"
#include "chrome/browser/safe_browsing/download_protection/download_protection_service.h"
#include "chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "components/safe_browsing/buildflags.h"
#include "components/safe_browsing/core/browser/db/v4_local_database_manager.h"
#include "components/safe_browsing/core/common/features.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/preferences/public/mojom/tracked_preference_validation_delegate.mojom.h"
namespace safe_browsing {
namespace {
const char* MigrateResultToString(HashPrefixMap::MigrateResult result) { … }
}
std::unique_ptr<ServicesDelegate> ServicesDelegate::Create(
SafeBrowsingService* safe_browsing_service) { … }
std::unique_ptr<ServicesDelegate> ServicesDelegate::CreateForTest(
SafeBrowsingService* safe_browsing_service,
ServicesDelegate::ServicesCreator* services_creator) { … }
ServicesDelegateDesktop::ServicesDelegateDesktop(
SafeBrowsingService* safe_browsing_service,
ServicesDelegate::ServicesCreator* services_creator)
: … { … }
ServicesDelegateDesktop::~ServicesDelegateDesktop() { … }
ExtendedReportingLevel
ServicesDelegateDesktop::GetEstimatedExtendedReportingLevel() const { … }
const scoped_refptr<SafeBrowsingDatabaseManager>&
ServicesDelegateDesktop::database_manager() const { … }
void ServicesDelegateDesktop::Initialize() { … }
void ServicesDelegateDesktop::SetDatabaseManagerForTest(
SafeBrowsingDatabaseManager* database_manager_to_set) { … }
void ServicesDelegateDesktop::ShutdownServices() { … }
void ServicesDelegateDesktop::RefreshState(bool enable) { … }
std::unique_ptr<prefs::mojom::TrackedPreferenceValidationDelegate>
ServicesDelegateDesktop::CreatePreferenceValidationDelegate(Profile* profile) { … }
void ServicesDelegateDesktop::RegisterDelayedAnalysisCallback(
DelayedAnalysisCallback callback) { … }
void ServicesDelegateDesktop::AddDownloadManager(
content::DownloadManager* download_manager) { … }
DownloadProtectionService* ServicesDelegateDesktop::GetDownloadService() { … }
scoped_refptr<SafeBrowsingDatabaseManager>
ServicesDelegateDesktop::CreateDatabaseManager() { … }
DownloadProtectionService*
ServicesDelegateDesktop::CreateDownloadProtectionService() { … }
IncidentReportingService*
ServicesDelegateDesktop::CreateIncidentReportingService() { … }
void ServicesDelegateDesktop::StartOnUIThread(
scoped_refptr<network::SharedURLLoaderFactory> browser_url_loader_factory,
const V4ProtocolConfig& v4_config) { … }
void ServicesDelegateDesktop::StopOnUIThread(bool shutdown) { … }
void ServicesDelegateDesktop::OnProfileWillBeDestroyed(Profile* profile) { … }
void ServicesDelegateDesktop::UpdateSyntheticFieldTrial(
HashPrefixMap::MigrateResult result) { … }
}