#include "chrome/browser/enterprise/data_protection/print_utils.h"
#include <cstring>
#include <optional>
#include <utility>
#include "base/feature_list.h"
#include "base/memory/read_only_shared_memory_region.h"
#include "base/metrics/histogram_functions.h"
#include "chrome/browser/profiles/profile.h"
#include "components/device_event_log/device_event_log.h"
#include "components/enterprise/buildflags/buildflags.h"
#include "content/public/browser/web_contents.h"
#include "printing/printing_features.h"
namespace enterprise_data_protection {
namespace {
bool ShouldScan(PrintScanningContext context) { … }
void RecordPrintType(
PrintScanningContext context,
const enterprise_connectors::ContentAnalysisDelegate::Data& scanning_data) { … }
}
void PrintIfAllowedByPolicy(scoped_refptr<base::RefCountedMemory> print_data,
content::WebContents* initiator,
std::string printer_name,
PrintScanningContext context,
base::OnceCallback<void(bool)> on_verdict,
base::OnceClosure hide_preview) { … }
void PrintIfAllowedByPolicy(
scoped_refptr<base::RefCountedMemory> print_data,
content::WebContents* initiator,
enterprise_connectors::ContentAnalysisDelegate::Data scanning_data,
base::OnceCallback<void(bool)> on_verdict) { … }
std::optional<enterprise_connectors::ContentAnalysisDelegate::Data>
GetPrintAnalysisData(content::WebContents* web_contents,
PrintScanningContext context) { … }
}