#include "chrome/browser/serial/serial_policy_allowed_ports.h"
#include <optional>
#include <vector>
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/values.h"
#include "chrome/common/pref_names.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_service.h"
#include "services/device/public/mojom/serial.mojom.h"
#include "url/gurl.h"
namespace {
constexpr char kPrefDevicesKey[] = …;
constexpr char kPrefUrlsKey[] = …;
constexpr char kPrefVendorIdKey[] = …;
constexpr char kPrefProductIdKey[] = …;
}
SerialPolicyAllowedPorts::SerialPolicyAllowedPorts(PrefService* pref_service) { … }
SerialPolicyAllowedPorts::~SerialPolicyAllowedPorts() = default;
void SerialPolicyAllowedPorts::RegisterPrefs(PrefRegistrySimple* registry) { … }
bool SerialPolicyAllowedPorts::HasPortPermission(
const url::Origin& origin,
const device::mojom::SerialPortInfo& port_info) { … }
void SerialPolicyAllowedPorts::LoadAllowAllPortsForUrlsPolicy() { … }
void SerialPolicyAllowedPorts::LoadAllowUsbDevicesForUrlsPolicy() { … }