chromium/chrome/browser/enterprise/connectors/test/fake_content_analysis_delegate.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/enterprise/connectors/test/fake_content_analysis_delegate.h"

#include <optional>

#include "base/task/single_thread_task_runner.h"
#include "base/test/bind.h"
#include "base/time/time.h"
#include "chrome/browser/enterprise/connectors/test/fake_files_request_handler.h"
#include "chrome/browser/safe_browsing/cloud_content_scanning/binary_upload_service.h"
#include "components/enterprise/common/proto/connectors.pb.h"

namespace enterprise_connectors::test {

namespace {

base::TimeDelta response_delay =;

}  // namespace

safe_browsing::BinaryUploadService::Result
    FakeContentAnalysisDelegate::result_ =;
bool FakeContentAnalysisDelegate::dialog_shown_ =;
bool FakeContentAnalysisDelegate::dialog_canceled_ =;
int64_t FakeContentAnalysisDelegate::total_analysis_requests_count_ =;

FakeContentAnalysisDelegate::FakeContentAnalysisDelegate(
    base::RepeatingClosure delete_closure,
    StatusCallback status_callback,
    std::string dm_token,
    content::WebContents* web_contents,
    Data data,
    CompletionCallback callback)
    :{}

FakeContentAnalysisDelegate::~FakeContentAnalysisDelegate() {}

// static
void FakeContentAnalysisDelegate::SetResponseResult(
    safe_browsing::BinaryUploadService::Result result) {}

// static
void FakeContentAnalysisDelegate::
    ResetStaticDialogFlagsAndTotalRequestsCount() {}

// static
bool FakeContentAnalysisDelegate::WasDialogShown() {}

// static
bool FakeContentAnalysisDelegate::WasDialogCanceled() {}

int FakeContentAnalysisDelegate::GetTotalAnalysisRequestsCount() {}

// static
std::unique_ptr<ContentAnalysisDelegate> FakeContentAnalysisDelegate::Create(
    base::RepeatingClosure delete_closure,
    StatusCallback status_callback,
    std::string dm_token,
    content::WebContents* web_contents,
    Data data,
    CompletionCallback callback) {}

// static
void FakeContentAnalysisDelegate::SetResponseDelay(base::TimeDelta delay) {}

// static
ContentAnalysisResponse FakeContentAnalysisDelegate::SuccessfulResponse(
    const std::set<std::string>& tags) {}

// static
ContentAnalysisResponse FakeContentAnalysisDelegate::MalwareResponse(
    TriggeredRule::Action action) {}

// static
ContentAnalysisResponse FakeContentAnalysisDelegate::DlpResponse(
    ContentAnalysisResponse::Result::Status status,
    const std::string& rule_name,
    TriggeredRule::Action action) {}

// static
ContentAnalysisResponse FakeContentAnalysisDelegate::MalwareAndDlpResponse(
    TriggeredRule::Action malware_action,
    ContentAnalysisResponse::Result::Status dlp_status,
    const std::string& dlp_rule_name,
    TriggeredRule::Action dlp_action) {}

void FakeContentAnalysisDelegate::Response(
    std::string contents,
    base::FilePath path,
    std::unique_ptr<safe_browsing::BinaryUploadService::Request> request,
    std::optional<FakeFilesRequestHandler::FakeFileRequestCallback>
        file_request_callback,
    bool is_image_request) {}

void FakeContentAnalysisDelegate::UploadTextForDeepScanning(
    std::unique_ptr<safe_browsing::BinaryUploadService::Request> request) {}

void FakeContentAnalysisDelegate::UploadImageForDeepScanning(
    std::unique_ptr<safe_browsing::BinaryUploadService::Request> request) {}

void FakeContentAnalysisDelegate::FakeUploadFileForDeepScanning(
    safe_browsing::BinaryUploadService::Result result,
    const base::FilePath& path,
    std::unique_ptr<safe_browsing::BinaryUploadService::Request> request,
    FakeFilesRequestHandler::FakeFileRequestCallback callback) {}

void FakeContentAnalysisDelegate::UploadPageForDeepScanning(
    std::unique_ptr<safe_browsing::BinaryUploadService::Request> request) {}

bool FakeContentAnalysisDelegate::ShowFinalResultInDialog() {}

bool FakeContentAnalysisDelegate::CancelDialog() {}

safe_browsing::BinaryUploadService*
FakeContentAnalysisDelegate::GetBinaryUploadService() {}

}  // namespace enterprise_connectors::test