#include "extensions/common/api/hid.h"
#include <memory>
#include <optional>
#include <ostream>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include "base/check.h"
#include "base/check_op.h"
#include "base/notreached.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "tools/json_schema_compiler/util.h"
UTF8ToUTF16;
namespace extensions {
namespace api {
namespace hid {
HidCollectionInfo::HidCollectionInfo()
: … { … }
HidCollectionInfo::~HidCollectionInfo() = default;
HidCollectionInfo::HidCollectionInfo(HidCollectionInfo&& rhs) noexcept = default;
HidCollectionInfo& HidCollectionInfo::operator=(HidCollectionInfo&& rhs) noexcept = default;
HidCollectionInfo HidCollectionInfo::Clone() const { … }
bool HidCollectionInfo::Populate(
const base::Value::Dict& dict, HidCollectionInfo& out) { … }
bool HidCollectionInfo::Populate(
const base::Value& value, HidCollectionInfo& out) { … }
std::optional<HidCollectionInfo> HidCollectionInfo::FromValue(const base::Value::Dict& value) { … }
std::optional<HidCollectionInfo> HidCollectionInfo::FromValue(const base::Value& value) { … }
base::Value::Dict HidCollectionInfo::ToValue() const { … }
HidDeviceInfo::HidDeviceInfo()
: … { … }
HidDeviceInfo::~HidDeviceInfo() = default;
HidDeviceInfo::HidDeviceInfo(HidDeviceInfo&& rhs) noexcept = default;
HidDeviceInfo& HidDeviceInfo::operator=(HidDeviceInfo&& rhs) noexcept = default;
HidDeviceInfo HidDeviceInfo::Clone() const { … }
bool HidDeviceInfo::Populate(
const base::Value::Dict& dict, HidDeviceInfo& out) { … }
bool HidDeviceInfo::Populate(
const base::Value& value, HidDeviceInfo& out) { … }
std::optional<HidDeviceInfo> HidDeviceInfo::FromValue(const base::Value::Dict& value) { … }
std::optional<HidDeviceInfo> HidDeviceInfo::FromValue(const base::Value& value) { … }
base::Value::Dict HidDeviceInfo::ToValue() const { … }
HidConnectInfo::HidConnectInfo()
: … { … }
HidConnectInfo::~HidConnectInfo() = default;
HidConnectInfo::HidConnectInfo(HidConnectInfo&& rhs) noexcept = default;
HidConnectInfo& HidConnectInfo::operator=(HidConnectInfo&& rhs) noexcept = default;
HidConnectInfo HidConnectInfo::Clone() const { … }
bool HidConnectInfo::Populate(
const base::Value::Dict& dict, HidConnectInfo& out) { … }
bool HidConnectInfo::Populate(
const base::Value& value, HidConnectInfo& out) { … }
std::optional<HidConnectInfo> HidConnectInfo::FromValue(const base::Value::Dict& value) { … }
std::optional<HidConnectInfo> HidConnectInfo::FromValue(const base::Value& value) { … }
base::Value::Dict HidConnectInfo::ToValue() const { … }
DeviceFilter::DeviceFilter()
{ … }
DeviceFilter::~DeviceFilter() = default;
DeviceFilter::DeviceFilter(DeviceFilter&& rhs) noexcept = default;
DeviceFilter& DeviceFilter::operator=(DeviceFilter&& rhs) noexcept = default;
DeviceFilter DeviceFilter::Clone() const { … }
bool DeviceFilter::Populate(
const base::Value::Dict& dict, DeviceFilter& out) { … }
bool DeviceFilter::Populate(
const base::Value& value, DeviceFilter& out) { … }
std::optional<DeviceFilter> DeviceFilter::FromValue(const base::Value::Dict& value) { … }
std::optional<DeviceFilter> DeviceFilter::FromValue(const base::Value& value) { … }
base::Value::Dict DeviceFilter::ToValue() const { … }
GetDevicesOptions::GetDevicesOptions()
{ … }
GetDevicesOptions::~GetDevicesOptions() = default;
GetDevicesOptions::GetDevicesOptions(GetDevicesOptions&& rhs) noexcept = default;
GetDevicesOptions& GetDevicesOptions::operator=(GetDevicesOptions&& rhs) noexcept = default;
GetDevicesOptions GetDevicesOptions::Clone() const { … }
bool GetDevicesOptions::Populate(
const base::Value::Dict& dict, GetDevicesOptions& out) { … }
bool GetDevicesOptions::Populate(
const base::Value& value, GetDevicesOptions& out) { … }
std::optional<GetDevicesOptions> GetDevicesOptions::FromValue(const base::Value::Dict& value) { … }
std::optional<GetDevicesOptions> GetDevicesOptions::FromValue(const base::Value& value) { … }
base::Value::Dict GetDevicesOptions::ToValue() const { … }
namespace GetDevices {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create(const std::vector<HidDeviceInfo>& devices) { … }
}
namespace Connect {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create(const HidConnectInfo& connection) { … }
}
namespace Disconnect {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create() { … }
}
namespace Receive {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create(int report_id, const std::vector<uint8_t>& data) { … }
}
namespace Send {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create() { … }
}
namespace ReceiveFeatureReport {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create(const std::vector<uint8_t>& data) { … }
}
namespace SendFeatureReport {
Params::Params() = default;
Params::~Params() = default;
Params::Params(Params&& rhs) noexcept = default;
Params& Params::operator=(Params&& rhs) noexcept = default;
std::optional<Params> Params::Create(const base::Value::List& args) { … }
base::Value::List Results::Create() { … }
}
namespace OnDeviceAdded {
const char kEventName[] = …;
base::Value::List Create(const HidDeviceInfo& device) { … }
}
namespace OnDeviceRemoved {
const char kEventName[] = …;
base::Value::List Create(int device_id) { … }
}
}
}
}