#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "chrome/browser/extensions/chrome_content_verifier_delegate.h"
#include <algorithm>
#include <memory>
#include <set>
#include <vector>
#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/containers/contains.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/escape.h"
#include "base/strings/string_util.h"
#include "base/syslog_logging.h"
#include "base/version.h"
#include "build/branding_buildflags.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "build/config/chromebox_for_meetings/buildflags.h"
#include "chrome/browser/extensions/corrupted_extension_reinstaller.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/install_verifier.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension_constants.h"
#include "extensions/browser/disable_reason.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/management_policy.h"
#include "extensions/browser/pref_types.h"
#include "extensions/common/extension_id.h"
#include "extensions/common/extension_urls.h"
#include "extensions/common/extensions_client.h"
#include "extensions/common/manifest.h"
#include "extensions/common/manifest_url_handlers.h"
#include "extensions/common/switches.h"
#include "net/base/backoff_entry.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/extensions/extension_assets_manager_chromeos.h"
#endif
namespace extensions {
namespace {
std::optional<ChromeContentVerifierDelegate::VerifyInfo::Mode>&
GetModeForTesting() { … }
const char kContentVerificationExperimentName[] = …;
ChromeContentVerifierDelegate::GetVerifyInfoTestOverride::VerifyInfoCallback*
g_verify_info_test_callback = …;
}
ChromeContentVerifierDelegate::GetVerifyInfoTestOverride::
GetVerifyInfoTestOverride(VerifyInfoCallback callback)
: … { … }
ChromeContentVerifierDelegate::GetVerifyInfoTestOverride::
~GetVerifyInfoTestOverride() { … }
ChromeContentVerifierDelegate::VerifyInfo::VerifyInfo(Mode mode,
bool is_from_webstore,
bool should_repair)
: … { … }
ChromeContentVerifierDelegate::VerifyInfo::Mode
ChromeContentVerifierDelegate::GetDefaultMode() { … }
void ChromeContentVerifierDelegate::SetDefaultModeForTesting(
std::optional<VerifyInfo::Mode> mode) { … }
ChromeContentVerifierDelegate::ChromeContentVerifierDelegate(
content::BrowserContext* context)
: … { … }
ChromeContentVerifierDelegate::~ChromeContentVerifierDelegate() { … }
ContentVerifierDelegate::VerifierSourceType
ChromeContentVerifierDelegate::GetVerifierSourceType(
const Extension& extension) { … }
ContentVerifierKey ChromeContentVerifierDelegate::GetPublicKey() { … }
GURL ChromeContentVerifierDelegate::GetSignatureFetchUrl(
const ExtensionId& extension_id,
const base::Version& version) { … }
std::set<base::FilePath> ChromeContentVerifierDelegate::GetBrowserImagePaths(
const Extension* extension) { … }
void ChromeContentVerifierDelegate::VerifyFailed(
const ExtensionId& extension_id,
ContentVerifyJob::FailureReason reason) { … }
void ChromeContentVerifierDelegate::Shutdown() { … }
bool ChromeContentVerifierDelegate::IsFromWebstore(
const Extension& extension) const { … }
ChromeContentVerifierDelegate::VerifyInfo
ChromeContentVerifierDelegate::GetVerifyInfo(const Extension& extension) const { … }
}