#include "chrome/browser/enterprise/data_controls/reporting_service.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.h"
#include "components/enterprise/data_controls/core/browser/prefs.h"
#include "components/enterprise/data_controls/core/browser/verdict.h"
#include "components/policy/core/common/policy_types.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/clipboard_types.h"
#include "ui/base/clipboard/clipboard_constants.h"
#include "ui/base/clipboard/clipboard_format_type.h"
namespace data_controls {
namespace {
std::string GetMimeType(const ui::ClipboardFormatType& clipboard_format) { … }
GURL GetURL(const content::ClipboardEndpoint& endpoint) { … }
safe_browsing::EventResult GetEventResult(Rule::Level level) { … }
bool PolicyAppliedAtUserScope(content::BrowserContext* browser_context,
const char* scope_pref) { … }
}
std::string ReportingService::GetClipboardSourceString(
const content::ClipboardEndpoint& source,
const content::ClipboardEndpoint& destination,
const char* scope_pref) { … }
ReportingService::ReportingService(content::BrowserContext& browser_context)
: … { … }
ReportingService::~ReportingService() = default;
void ReportingService::ReportPaste(
const content::ClipboardEndpoint& source,
const content::ClipboardEndpoint& destination,
const content::ClipboardMetadata& metadata,
const Verdict& verdict) { … }
void ReportingService::ReportPasteWarningBypassed(
const content::ClipboardEndpoint& source,
const content::ClipboardEndpoint& destination,
const content::ClipboardMetadata& metadata,
const Verdict& verdict) { … }
void ReportingService::ReportCopy(const content::ClipboardEndpoint& source,
const content::ClipboardMetadata& metadata,
const Verdict& verdict) { … }
void ReportingService::ReportCopyWarningBypassed(
const content::ClipboardEndpoint& source,
const content::ClipboardMetadata& metadata,
const Verdict& verdict) { … }
void ReportingService::ReportCopyOrPaste(
const content::ClipboardEndpoint& source,
const std::optional<content::ClipboardEndpoint>& destination,
const content::ClipboardMetadata& metadata,
const Verdict& verdict,
const std::string& trigger,
safe_browsing::EventResult event_result) { … }
ReportingServiceBase* ReportingServiceFactory::GetForBrowserContext(
content::BrowserContext* context) { … }
ReportingServiceFactory* ReportingServiceFactory::GetInstance() { … }
ReportingServiceFactory::ReportingServiceFactory()
: … { … }
ReportingServiceFactory::~ReportingServiceFactory() = default;
std::unique_ptr<KeyedService>
ReportingServiceFactory::BuildServiceInstanceForBrowserContext(
content::BrowserContext* context) const { … }
}