#include "services/device/serial/serial_device_enumerator.h"
#include <utility>
#include "base/not_fatal_until.h"
#include "base/observer_list.h"
#include "base/task/single_thread_task_runner.h"
#include "base/unguessable_token.h"
#include "build/build_config.h"
#include "components/device_event_log/device_event_log.h"
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#include "services/device/serial/serial_device_enumerator_linux.h"
#elif BUILDFLAG(IS_MAC)
#include "services/device/serial/serial_device_enumerator_mac.h"
#elif BUILDFLAG(IS_WIN)
#include "services/device/serial/serial_device_enumerator_win.h"
#endif
namespace device {
std::unique_ptr<SerialDeviceEnumerator> SerialDeviceEnumerator::Create(
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { … }
SerialDeviceEnumerator::SerialDeviceEnumerator() = default;
SerialDeviceEnumerator::~SerialDeviceEnumerator() = default;
std::vector<mojom::SerialPortInfoPtr> SerialDeviceEnumerator::GetDevices() { … }
void SerialDeviceEnumerator::AddObserver(Observer* observer) { … }
void SerialDeviceEnumerator::RemoveObserver(Observer* observer) { … }
std::optional<base::FilePath> SerialDeviceEnumerator::GetPathFromToken(
const base::UnguessableToken& token,
bool use_alternate_path) { … }
void SerialDeviceEnumerator::AddPort(mojom::SerialPortInfoPtr port) { … }
void SerialDeviceEnumerator::RemovePort(base::UnguessableToken token) { … }
void SerialDeviceEnumerator::UpdatePortConnectedState(
base::UnguessableToken token,
bool is_connected) { … }
}