#include "chrome/browser/private_network_access/private_network_device_permission_context.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/profiles/profile.h"
namespace {
constexpr char kDeviceNameKey[] = …;
constexpr char kDeviceIdKey[] = …;
constexpr char kIPAddressKey[] = …;
}
PrivateNetworkDevicePermissionContext::PrivateNetworkDevicePermissionContext(
Profile* profile)
: … { … }
PrivateNetworkDevicePermissionContext::
~PrivateNetworkDevicePermissionContext() = default;
std::string PrivateNetworkDevicePermissionContext::GetKeyForObject(
const base::Value::Dict& object) { … }
std::u16string PrivateNetworkDevicePermissionContext::GetObjectDisplayName(
const base::Value::Dict& object) { … }
bool PrivateNetworkDevicePermissionContext::IsValidObject(
const base::Value::Dict& object) { … }
void PrivateNetworkDevicePermissionContext::GrantDevicePermission(
const url::Origin& origin,
const blink::mojom::PrivateNetworkDevice& device,
bool is_device_valid) { … }
bool PrivateNetworkDevicePermissionContext::HasDevicePermission(
const url::Origin& origin,
const blink::mojom::PrivateNetworkDevice& device,
bool is_device_valid) { … }
void PrivateNetworkDevicePermissionContext::Shutdown() { … }
base::WeakPtr<PrivateNetworkDevicePermissionContext>
PrivateNetworkDevicePermissionContext::AsWeakPtr() { … }
base::Value::Dict PrivateNetworkDevicePermissionContext::DeviceInfoToValue(
const blink::mojom::PrivateNetworkDevice& device) { … }