#include "components/permissions/object_permission_context_base.h"
#include <string_view>
#include <utility>
#include "base/containers/contains.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/observer_list.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/values.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/permissions/features.h"
#include "url/origin.h"
namespace permissions {
const char kObjectListKey[] = …;
ObjectPermissionContextBase::ObjectPermissionContextBase(
ContentSettingsType guard_content_settings_type,
ContentSettingsType data_content_settings_type,
HostContentSettingsMap* host_content_settings_map)
: … { … }
ObjectPermissionContextBase::ObjectPermissionContextBase(
ContentSettingsType data_content_settings_type,
HostContentSettingsMap* host_content_settings_map)
: … { … }
ObjectPermissionContextBase::~ObjectPermissionContextBase() { … }
ObjectPermissionContextBase::Object::Object(
const url::Origin& origin,
base::Value::Dict value,
content_settings::SettingSource source,
bool incognito)
: … { … }
ObjectPermissionContextBase::Object::Object(
const url::Origin& origin,
base::Value value,
content_settings::SettingSource source,
bool incognito)
: … { … }
ObjectPermissionContextBase::Object::~Object() = default;
std::unique_ptr<ObjectPermissionContextBase::Object>
ObjectPermissionContextBase::Object::Clone() { … }
void ObjectPermissionContextBase::PermissionObserver::OnObjectPermissionChanged(
std::optional<ContentSettingsType> guard_content_settings_type,
ContentSettingsType data_content_settings_type) { … }
void ObjectPermissionContextBase::PermissionObserver::OnPermissionRevoked(
const url::Origin& origin) { … }
void ObjectPermissionContextBase::AddObserver(PermissionObserver* observer) { … }
void ObjectPermissionContextBase::RemoveObserver(PermissionObserver* observer) { … }
bool ObjectPermissionContextBase::CanRequestObjectPermission(
const url::Origin& origin) { … }
std::unique_ptr<ObjectPermissionContextBase::Object>
ObjectPermissionContextBase::GetGrantedObject(const url::Origin& origin,
const std::string_view key) { … }
std::vector<std::unique_ptr<ObjectPermissionContextBase::Object>>
ObjectPermissionContextBase::GetGrantedObjects(const url::Origin& origin) { … }
std::set<url::Origin> ObjectPermissionContextBase::GetOriginsWithGrants() { … }
std::vector<std::unique_ptr<ObjectPermissionContextBase::Object>>
ObjectPermissionContextBase::GetAllGrantedObjects() { … }
void ObjectPermissionContextBase::GrantObjectPermission(
const url::Origin& origin,
base::Value::Dict object) { … }
void ObjectPermissionContextBase::UpdateObjectPermission(
const url::Origin& origin,
const base::Value::Dict& old_object,
base::Value::Dict new_object) { … }
void ObjectPermissionContextBase::RevokeObjectPermission(
const url::Origin& origin,
const base::Value::Dict& object) { … }
void ObjectPermissionContextBase::RevokeObjectPermission(
const url::Origin& origin,
const std::string_view key) { … }
bool ObjectPermissionContextBase::RevokeObjectPermissions(
const url::Origin& origin) { … }
void ObjectPermissionContextBase::FlushScheduledSaveSettingsCalls() { … }
bool ObjectPermissionContextBase::IsOffTheRecord() { … }
void ObjectPermissionContextBase::NotifyPermissionChanged() { … }
void ObjectPermissionContextBase::NotifyPermissionRevoked(
const url::Origin& origin) { … }
base::Value::Dict ObjectPermissionContextBase::GetWebsiteSetting(
const url::Origin& origin,
content_settings::SettingInfo* info) { … }
void ObjectPermissionContextBase::SaveWebsiteSetting(
const url::Origin& origin) { … }
void ObjectPermissionContextBase::ScheduleSaveWebsiteSetting(
const url::Origin& origin) { … }
std::vector<std::unique_ptr<ObjectPermissionContextBase::Object>>
ObjectPermissionContextBase::GetWebsiteSettingObjects() { … }
void ObjectPermissionContextBase::LoadWebsiteSettingsIntoObjects() { … }
ObjectPermissionContextBase::ObjectMap& ObjectPermissionContextBase::objects() { … }
}