#include "chrome/browser/hid/hid_policy_allowed_devices.h"
#include <optional>
#include <string>
#include <vector>
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/values.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
#include "services/device/public/mojom/hid.mojom.h"
#include "url/gurl.h"
namespace {
constexpr char kPrefDevicesKey[] = …;
constexpr char kPrefProductIdKey[] = …;
constexpr char kPrefUrlsKey[] = …;
constexpr char kPrefUsageKey[] = …;
constexpr char kPrefUsagePageKey[] = …;
constexpr char kPrefUsagesKey[] = …;
constexpr char kPrefVendorIdKey[] = …;
}
HidPolicyAllowedDevices::HidPolicyAllowedDevices(PrefService* pref_service,
bool on_login_screen)
: … { … }
HidPolicyAllowedDevices::~HidPolicyAllowedDevices() = default;
void HidPolicyAllowedDevices::RegisterLocalStatePrefs(
PrefRegistrySimple* registry) { … }
bool HidPolicyAllowedDevices::HasDevicePermission(
const url::Origin& origin,
const device::mojom::HidDeviceInfo& device) { … }
void HidPolicyAllowedDevices::LoadAllowAllDevicesForUrlsPolicy() { … }
void HidPolicyAllowedDevices::LoadAllowDevicesForUrlsPolicy() { … }
void HidPolicyAllowedDevices::LoadAllowDevicesWithHidUsagesForUrlsPolicy() { … }