#include "chrome/browser/extensions/installed_loader.h"
#include <stddef.h>
#include <memory>
#include <optional>
#include <string>
#include <vector>
#include "base/files/file_path.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_restrictions.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "base/values.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/corrupted_extension_reinstaller.h"
#include "chrome/browser/extensions/extension_management.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/extensions/load_error_reporter.h"
#include "chrome/browser/extensions/profile_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/chrome_manifest_url_handlers.h"
#include "chrome/common/extensions/manifest_handlers/settings_overrides_handler.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/webui_url_constants.h"
#include "components/safe_browsing/core/common/safe_browsing_prefs.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/url_constants.h"
#include "extensions/browser/allowlist_state.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/extension_util.h"
#include "extensions/browser/management_policy.h"
#include "extensions/browser/permissions_manager.h"
#include "extensions/browser/pref_types.h"
#include "extensions/browser/ui_util.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_l10n_util.h"
#include "extensions/common/extension_set.h"
#include "extensions/common/extension_urls.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/background_info.h"
#include "extensions/common/permissions/api_permission.h"
#include "extensions/common/permissions/permissions_data.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/ash/profiles/profile_helper.h"
#include "components/user_manager/user.h"
#endif
BrowserThread;
namespace extensions {
namespace {
enum class ManifestVersionPopulationSplit { … };
enum ManifestReloadReason { … };
enum BackgroundPageType { … };
enum ExternalItemState { … };
bool IsManifestCorrupt(const base::Value::Dict& manifest) { … }
ManifestReloadReason ShouldReloadExtensionManifest(const ExtensionInfo& info) { … }
BackgroundPageType GetBackgroundPageType(const Extension* extension) { … }
void RecordDisbleReasonHistogram(int reason) { … }
void RecordDisableReasons(int reasons) { … }
HostPermissionsAccess GetHostPermissionAccessLevelForExtension(
const Extension& extension) { … }
void LogHostPermissionsAccess(const Extension& extension,
bool should_record_incremented_metrics) { … }
}
InstalledLoader::InstalledLoader(ExtensionService* extension_service)
: … { … }
InstalledLoader::~InstalledLoader() { … }
void InstalledLoader::Load(const ExtensionInfo& info, bool write_to_prefs) { … }
void InstalledLoader::LoadAllExtensions() { … }
void InstalledLoader::LoadAllExtensions(Profile* profile) { … }
void InstalledLoader::RecordExtensionsMetricsForTesting() { … }
void InstalledLoader::RecordExtensionsIncrementedMetricsForTesting(
Profile* profile) { … }
void InstalledLoader::RecordExtensionsMetrics(Profile* profile,
bool is_user_profile) { … }
int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { … }
}