#include "extensions/browser/blocklist_extension_prefs.h"
#include <optional>
#include "extensions/browser/blocklist_state.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/common/extension_id.h"
namespace extensions {
namespace {
constexpr const char kPrefOmahaBlocklistState[] = …;
constexpr const char kPrefAcknowledgedBlocklistState[] = …;
constexpr const char kPrefBlocklistState[] = …;
constexpr const char kPrefExtensionTelemetryServiceBlocklistState[] = …;
constexpr BitMapBlocklistState kDefaultBitMapBlocklistState = …;
const BitMapBlocklistState kGreylistStates[] = …;
const int kAllGreylistStates = …;
BlocklistState BitMapBlocklistStateToBlocklistState(
BitMapBlocklistState blocklist_state) { … }
}
namespace blocklist_prefs {
BitMapBlocklistState BlocklistStateToBitMapBlocklistState(
BlocklistState blocklist_state) { … }
BitMapBlocklistState GetExtensionBlocklistState(
const ExtensionId& extension_id,
const ExtensionPrefs* extension_prefs) { … }
bool IsExtensionBlocklisted(const ExtensionId& extension_id,
ExtensionPrefs* extension_prefs) { … }
void AddOmahaBlocklistState(const ExtensionId& extension_id,
BitMapBlocklistState state,
ExtensionPrefs* extension_prefs) { … }
void RemoveOmahaBlocklistState(const ExtensionId& extension_id,
BitMapBlocklistState state,
ExtensionPrefs* extension_prefs) { … }
bool HasOmahaBlocklistState(const ExtensionId& extension_id,
BitMapBlocklistState state,
const ExtensionPrefs* extension_prefs) { … }
bool HasAnyOmahaGreylistState(const ExtensionId& extension_id,
ExtensionPrefs* extension_prefs) { … }
void AddAcknowledgedBlocklistState(const ExtensionId& extension_id,
BitMapBlocklistState state,
ExtensionPrefs* extension_prefs) { … }
void RemoveAcknowledgedBlocklistState(
const ExtensionId& extension_id,
BitMapBlocklistState state,
extensions::ExtensionPrefs* extension_prefs) { … }
void ClearAcknowledgedGreylistStates(const ExtensionId& extension_id,
ExtensionPrefs* extension_prefs) { … }
bool HasAcknowledgedBlocklistState(const ExtensionId& extension_id,
BitMapBlocklistState state,
const ExtensionPrefs* extension_prefs) { … }
void UpdateCurrentGreylistStatesAsAcknowledged(
const ExtensionId& extension_id,
ExtensionPrefs* extension_prefs) { … }
void SetSafeBrowsingExtensionBlocklistState(
const ExtensionId& extension_id,
BitMapBlocklistState bitmap_blocklist_state,
ExtensionPrefs* extension_prefs) { … }
BitMapBlocklistState GetSafeBrowsingExtensionBlocklistState(
const ExtensionId& extension_id,
const ExtensionPrefs* extension_prefs) { … }
void SetExtensionTelemetryServiceBlocklistState(
const ExtensionId& extension_id,
BitMapBlocklistState bitmap_blocklist_state,
ExtensionPrefs* extension_prefs) { … }
BitMapBlocklistState GetExtensionTelemetryServiceBlocklistState(
const ExtensionId& extension_id,
const ExtensionPrefs* extension_prefs) { … }
}
}