#include "components/permissions/permission_actions_history.h"
#include <optional>
#include <string_view>
#include <vector>
#include "base/containers/adapters.h"
#include "base/json/values_util.h"
#include "base/ranges/algorithm.h"
#include "base/values.h"
#include "build/build_config.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/permissions/permission_util.h"
#include "components/permissions/pref_names.h"
#include "components/permissions/request_type.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
namespace permissions {
namespace {
constexpr char kPermissionActionEntryActionKey[] = …;
constexpr char kPermissionActionEntryTimestampKey[] = …;
constexpr char kPermissionActionEntryPromptDispositionKey[] = …;
constexpr base::TimeDelta kPermissionActionMaxAge = …;
}
std::vector<PermissionActionsHistory::Entry>
PermissionActionsHistory::GetHistory(const base::Time& begin,
EntryFilter entry_filter) { … }
std::vector<PermissionActionsHistory::Entry>
PermissionActionsHistory::GetHistory(const base::Time& begin,
RequestType type,
EntryFilter entry_filter) { … }
void PermissionActionsHistory::RecordAction(
PermissionAction action,
RequestType type,
PermissionPromptDisposition prompt_disposition) { … }
void PermissionActionsHistory::ClearHistory(const base::Time& delete_begin,
const base::Time& delete_end) { … }
PermissionActionsHistory::PermissionActionsHistory(PrefService* pref_service)
: … { … }
std::vector<PermissionActionsHistory::Entry>
PermissionActionsHistory::GetHistoryInternal(const base::Time& begin,
const std::string& key,
EntryFilter entry_filter) { … }
PrefService* PermissionActionsHistory::GetPrefServiceForTesting() { … }
void PermissionActionsHistory::FillInActionCounts(
PredictionRequestFeatures::ActionCounts* counts,
const std::vector<PermissionActionsHistory::Entry>& actions) { … }
void PermissionActionsHistory::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) { … }
}