#include "content/browser/xr/service/xr_permission_results.h"
#include <optional>
#include "base/containers/contains.h"
#include "device/vr/public/mojom/xr_session.mojom-shared.h"
#include "third_party/blink/public/common/permissions/permission_utils.h"
namespace {
base::flat_map<blink::PermissionType, blink::mojom::PermissionStatus>
CreatePermissionTypeToStatusMap(
const std::vector<blink::PermissionType>& permissions,
const std::vector<blink::mojom::PermissionStatus>& permission_statuses) { … }
}
namespace content {
XrPermissionResults::XrPermissionResults(
const std::vector<blink::PermissionType>& permission_types,
const std::vector<blink::mojom::PermissionStatus>& permission_statuses)
: … { … }
XrPermissionResults::~XrPermissionResults() = default;
bool XrPermissionResults::HasPermissionsFor(
device::mojom::XRSessionMode mode) const { … }
bool XrPermissionResults::HasPermissionsFor(
device::mojom::XRSessionFeature feature) const { … }
bool XrPermissionResults::HasPermissionsFor(
blink::PermissionType permission_type) const { … }
std::optional<blink::PermissionType> XrPermissionResults::GetPermissionFor(
device::mojom::XRSessionMode mode) { … }
std::optional<blink::PermissionType> XrPermissionResults::GetPermissionFor(
device::mojom::XRSessionFeature feature) { … }
}