#include "chrome/browser/extensions/extension_allowlist.h"
#include "base/metrics/histogram_functions.h"
#include "base/observer_list.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/safe_browsing/safe_browsing_metrics_collector_factory.h"
#include "components/safe_browsing/core/browser/safe_browsing_metrics_collector.h"
#include "components/safe_browsing/core/common/safe_browsing_prefs.h"
#include "extensions/browser/allowlist_state.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/extension_features.h"
#include "extensions/common/extension_id.h"
namespace extensions {
namespace {
enum class ExtensionAllowlistOmahaAttributeValue { … };
void ReportExtensionAllowlistOmahaAttribute(
const base::Value* allowlist_value) { … }
constexpr PrefMap kPrefAllowlist = …;
constexpr PrefMap kPrefAllowlistAcknowledge = …;
}
ExtensionAllowlist::ExtensionAllowlist(Profile* profile,
ExtensionPrefs* extension_prefs,
ExtensionService* extension_service)
: … { … }
ExtensionAllowlist::~ExtensionAllowlist() = default;
void ExtensionAllowlist::AddObserver(Observer* observer) { … }
void ExtensionAllowlist::RemoveObserver(Observer* observer) { … }
void ExtensionAllowlist::Init() { … }
AllowlistState ExtensionAllowlist::GetExtensionAllowlistState(
const ExtensionId& extension_id) const { … }
void ExtensionAllowlist::SetExtensionAllowlistState(
const ExtensionId& extension_id,
AllowlistState state) { … }
AllowlistAcknowledgeState
ExtensionAllowlist::GetExtensionAllowlistAcknowledgeState(
const ExtensionId& extension_id) const { … }
void ExtensionAllowlist::SetExtensionAllowlistAcknowledgeState(
const ExtensionId& extension_id,
AllowlistAcknowledgeState state) { … }
void ExtensionAllowlist::PerformActionBasedOnOmahaAttributes(
const ExtensionId& extension_id,
const base::Value::Dict& attributes) { … }
bool ExtensionAllowlist::ShouldDisplayWarning(
const ExtensionId& extension_id) const { … }
void ExtensionAllowlist::OnExtensionInstalled(const ExtensionId& extension_id,
int install_flags) { … }
void ExtensionAllowlist::SetAllowlistEnforcementFields() { … }
void ExtensionAllowlist::ApplyEnforcement(const ExtensionId& extension_id) { … }
void ExtensionAllowlist::ActivateAllowlistEnforcement() { … }
void ExtensionAllowlist::DeactivateAllowlistEnforcement() { … }
void ExtensionAllowlist::OnSafeBrowsingEnhancedChanged() { … }
void ExtensionAllowlist::OnExtensionStateChanged(
const ExtensionId& extension_id,
bool is_now_enabled) { … }
void ExtensionAllowlist::NotifyExtensionAllowlistWarningStateChanged(
const ExtensionId& extension_id,
bool show_warning) { … }
void ExtensionAllowlist::ReportExtensionReEnabledEvent() { … }
}