#include "chrome/browser/extensions/unpacked_installer.h"
#include <string>
#include <utility>
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/metrics/histogram_functions.h"
#include "base/path_service.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/branding_buildflags.h"
#include "chrome/browser/extensions/extension_management.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/load_error_reporter.h"
#include "chrome/browser/extensions/permissions/permissions_updater.h"
#include "chrome/browser/profiles/profile.h"
#include "components/crx_file/id_util.h"
#include "components/sync/model/string_ordinal.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/browser/api/declarative_net_request/file_backed_ruleset_source.h"
#include "extensions/browser/api/declarative_net_request/install_index_helper.h"
#include "extensions/browser/api/declarative_net_request/ruleset_source.h"
#include "extensions/browser/extension_file_task_runner.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_util.h"
#include "extensions/browser/install_flag.h"
#include "extensions/browser/install_prefs_helper.h"
#include "extensions/browser/path_util.h"
#include "extensions/browser/policy_check.h"
#include "extensions/browser/preload_check_group.h"
#include "extensions/browser/requirements_checker.h"
#include "extensions/browser/ruleset_parse_result.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_features.h"
#include "extensions/common/extension_l10n_util.h"
#include "extensions/common/features/feature_developer_mode_only.h"
#include "extensions/common/file_util.h"
#include "extensions/common/manifest.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/manifest_handlers/shared_module_info.h"
#include "extensions/common/mojom/manifest.mojom-shared.h"
#include "extensions/common/permissions/permissions_data.h"
BrowserThread;
Extension;
SharedModuleInfo;
namespace extensions {
namespace {
const char kUnpackedExtensionsBlocklistedError[] = …;
const char kImportMinVersionNewer[] = …;
const char kImportMissing[] = …;
const char kImportNotSharedModule[] = …;
void MaybeCleanupMetadataFolder(const base::FilePath& extension_path) { … }
}
scoped_refptr<UnpackedInstaller> UnpackedInstaller::Create(
ExtensionService* extension_service) { … }
UnpackedInstaller::UnpackedInstaller(ExtensionService* extension_service)
: … { … }
UnpackedInstaller::~UnpackedInstaller() { … }
void UnpackedInstaller::Load(const base::FilePath& path_in) { … }
bool UnpackedInstaller::LoadFromCommandLine(const base::FilePath& path_in,
std::string* extension_id,
bool only_allow_apps) { … }
void UnpackedInstaller::StartInstallChecks() { … }
void UnpackedInstaller::OnInstallChecksComplete(
const PreloadCheck::Errors& errors) { … }
int UnpackedInstaller::GetFlags() { … }
bool UnpackedInstaller::LoadExtension(mojom::ManifestLocation location,
int flags,
std::string* error) { … }
bool UnpackedInstaller::IndexAndPersistRulesIfNeeded(std::string* error) { … }
bool UnpackedInstaller::IsLoadingUnpackedAllowed() const { … }
void UnpackedInstaller::GetAbsolutePath() { … }
void UnpackedInstaller::CheckExtensionFileAccess() { … }
void UnpackedInstaller::LoadWithFileAccess(int flags) { … }
void UnpackedInstaller::ReportExtensionLoadError(const std::string &error) { … }
void UnpackedInstaller::InstallExtension() { … }
void UnpackedInstaller::RecordCommandLineDeveloperModeMetrics() { … }
}