#ifndef CHROME_BROWSER_ENTERPRISE_CONNECTORS_COMMON_H_
#define CHROME_BROWSER_ENTERPRISE_CONNECTORS_COMMON_H_
#include <string>
#include "base/functional/callback_forward.h"
#include "base/supports_user_data.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "components/enterprise/buildflags/buildflags.h"
#include "components/enterprise/connectors/core/analysis_settings.h"
#include "components/enterprise/connectors/core/common.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "content/public/browser/download_manager_delegate.h"
#if BUILDFLAG(ENTERPRISE_CONTENT_ANALYSIS)
#include "chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.h"
#include "chrome/browser/safe_browsing/cloud_content_scanning/deep_scanning_utils.h"
#endif
class Profile;
namespace content {
class WebContents;
}
namespace download {
class DownloadItem;
}
namespace enterprise_connectors {
struct SavePackageScanningData : public base::SupportsUserData::Data { … };
void RunSavePackageScanningCallback(download::DownloadItem* item, bool allowed);
bool IncludeDeviceInfo(Profile* profile, bool per_profile);
bool ShouldPromptReviewForDownload(Profile* profile,
const download::DownloadItem* download_item);
std::string GetProfileEmail(Profile* profile);
std::string GetProfileEmail(signin::IdentityManager* identity_manager);
#if BUILDFLAG(ENTERPRISE_CONTENT_ANALYSIS)
void ShowDownloadReviewDialog(const std::u16string& filename,
Profile* profile,
download::DownloadItem* download_item,
content::WebContents* web_contents,
base::OnceClosure keep_closure,
base::OnceClosure discard_closure);
RequestHandlerResult CalculateRequestHandlerResult(
const AnalysisSettings& settings,
safe_browsing::BinaryUploadService::Result upload_result,
const ContentAnalysisResponse& response);
bool ResultShouldAllowDataUse(
const AnalysisSettings& settings,
safe_browsing::BinaryUploadService::Result upload_result);
safe_browsing::EventResult CalculateEventResult(
const AnalysisSettings& settings,
bool allowed_by_scan_result,
bool should_warn);
bool IsResumableUpload(
const safe_browsing::BinaryUploadService::Request& request);
bool CloudMultipartResultIsFailure(
safe_browsing::BinaryUploadService::Result result);
bool CloudResumableResultIsFailure(
safe_browsing::BinaryUploadService::Result result,
bool block_large_files,
bool block_password_protected_files);
bool LocalResultIsFailure(safe_browsing::BinaryUploadService::Result result);
bool ResultIsFailClosed(safe_browsing::BinaryUploadService::Result result);
#endif
#if BUILDFLAG(IS_CHROMEOS_LACROS)
Profile* GetMainProfileLacros();
#endif
}
#endif