#include "chrome/browser/usb/usb_policy_allowed_devices.h"
#include <optional>
#include <string>
#include <vector>
#include "base/check_deref.h"
#include "base/functional/bind.h"
#include "base/strings/string_split.h"
#include "base/values.h"
#include "components/content_settings/core/common/pref_names.h"
#include "components/prefs/pref_service.h"
#include "services/device/public/mojom/usb_device.mojom.h"
#include "services/device/public/mojom/usb_manager.mojom.h"
#include "url/gurl.h"
namespace {
constexpr char kPrefDevicesKey[] = …;
constexpr char kPrefUrlsKey[] = …;
constexpr char kPrefVendorIdKey[] = …;
constexpr char kPrefProductIdKey[] = …;
}
UsbPolicyAllowedDevices::UsbPolicyAllowedDevices(PrefService* pref_service) { … }
UsbPolicyAllowedDevices::~UsbPolicyAllowedDevices() { … }
bool UsbPolicyAllowedDevices::IsDeviceAllowed(
const url::Origin& origin,
const device::mojom::UsbDeviceInfo& device_info) const { … }
bool UsbPolicyAllowedDevices::IsDeviceAllowed(
const url::Origin& origin,
const std::pair<int, int>& device_ids) const { … }
void UsbPolicyAllowedDevices::CreateOrUpdateMap() { … }