#include "chrome/browser/extensions/forced_extensions/force_installed_tracker.h"
#include "base/functional/bind.h"
#include "base/observer_list.h"
#include "base/values.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/extensions/extension_management_constants.h"
#include "chrome/browser/extensions/external_provider_impl.h"
#include "chrome/browser/extensions/forced_extensions/install_stage_tracker.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/profiles/profile.h"
#include "components/prefs/pref_change_registrar.h"
#include "components/prefs/pref_service.h"
#include "extensions/browser/install/crx_install_error.h"
#include "extensions/browser/install/sandboxed_unpacker_failure_reason.h"
#include "extensions/browser/pref_names.h"
#include "extensions/common/extension_urls.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/components/arc/arc_prefs.h"
#endif
namespace extensions {
namespace {
constexpr int kHttpErrorCodeBadRequest = …;
constexpr int kHttpErrorCodeForbidden = …;
constexpr int kHttpErrorCodeNotFound = …;
}
ForceInstalledTracker::ForceInstalledTracker(ExtensionRegistry* registry,
Profile* profile)
: … { … }
ForceInstalledTracker::~ForceInstalledTracker() { … }
void ForceInstalledTracker::UpdateCounters(ExtensionStatus status, int delta) { … }
void ForceInstalledTracker::AddExtensionInfo(const ExtensionId& extension_id,
ExtensionStatus status,
bool is_from_store) { … }
void ForceInstalledTracker::ChangeExtensionStatus(
const ExtensionId& extension_id,
ExtensionStatus status) { … }
void ForceInstalledTracker::OnPolicyUpdated(const policy::PolicyNamespace& ns,
const policy::PolicyMap& previous,
const policy::PolicyMap& current) { … }
void ForceInstalledTracker::OnPolicyServiceInitialized(
policy::PolicyDomain domain) { … }
void ForceInstalledTracker::OnInstallForcelistChanged() { … }
bool ForceInstalledTracker::ProceedIfForcedExtensionsPrefReady() { … }
void ForceInstalledTracker::OnForcedExtensionsPrefReady() { … }
void ForceInstalledTracker::OnShutdown(ExtensionRegistry*) { … }
void ForceInstalledTracker::AddObserver(Observer* obs) { … }
void ForceInstalledTracker::RemoveObserver(Observer* obs) { … }
void ForceInstalledTracker::OnExtensionLoaded(
content::BrowserContext* browser_context,
const Extension* extension) { … }
void ForceInstalledTracker::OnExtensionReady(
content::BrowserContext* browser_context,
const Extension* extension) { … }
void ForceInstalledTracker::OnExtensionInstallationFailed(
const ExtensionId& extension_id,
InstallStageTracker::FailureReason reason) { … }
bool ForceInstalledTracker::IsDoneLoading() const { … }
void ForceInstalledTracker::OnExtensionDownloadCacheStatusRetrieved(
const ExtensionId& id,
ExtensionDownloaderDelegate::CacheStatus cache_status) { … }
bool ForceInstalledTracker::IsReady() const { … }
bool ForceInstalledTracker::IsComplete() const { … }
bool ForceInstalledTracker::IsMisconfiguration(
const InstallStageTracker::InstallationData& installation_data,
const ExtensionId& id) const { … }
bool ForceInstalledTracker::IsExtensionFetchedFromCache(
const std::optional<ExtensionDownloaderDelegate::CacheStatus>& status) { … }
policy::PolicyService* ForceInstalledTracker::policy_service() { … }
void ForceInstalledTracker::MaybeNotifyObservers() { … }
}