#include "extensions/browser/api/declarative/rules_cache_delegate.h"
#include <utility>
#include "base/functional/bind.h"
#include "base/observer_list.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/browser/api/declarative/rules_registry.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/state_store.h"
#include "extensions/common/extension_id.h"
#include "extensions/common/permissions/permissions_data.h"
namespace {
std::string GetDeclarativeRuleStorageKey(const std::string& event_name,
bool incognito) { … }
}
namespace extensions {
const char RulesCacheDelegate::kRulesStoredKey[] = …;
RulesCacheDelegate::RulesCacheDelegate(Type type)
: … { … }
RulesCacheDelegate::~RulesCacheDelegate() = default;
std::string RulesCacheDelegate::GetRulesStoredKey(const std::string& event_name,
bool incognito) { … }
void RulesCacheDelegate::Init(RulesRegistry* registry) { … }
void RulesCacheDelegate::UpdateRules(const ExtensionId& extension_id,
base::Value::List value) { … }
bool RulesCacheDelegate::HasRules() const { … }
void RulesCacheDelegate::AddObserver(Observer* observer) { … }
void RulesCacheDelegate::RemoveObserver(Observer* observer) { … }
void RulesCacheDelegate::CheckIfReady() { … }
void RulesCacheDelegate::ReadRulesForInstalledExtensions() { … }
void RulesCacheDelegate::ReadFromStorage(const ExtensionId& extension_id) { … }
void RulesCacheDelegate::ReadFromStorageCallback(
const ExtensionId& extension_id,
std::optional<base::Value> value) { … }
bool RulesCacheDelegate::GetDeclarativeRulesStored(
const ExtensionId& extension_id) const { … }
void RulesCacheDelegate::SetDeclarativeRulesStored(
const ExtensionId& extension_id,
bool rules_stored) { … }
}