#include "components/sync_device_info/local_device_info_util.h"
#include <string_view>
#include "base/barrier_closure.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/strings/string_util.h"
#include "base/system/sys_info.h"
#include "base/task/thread_pool.h"
#include "base/threading/scoped_blocking_call.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/sync/protocol/sync_enums.pb.h"
#include "ui/base/device_form_factor.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chromeos/ash/components/system/statistics_provider.h"
#endif
namespace syncer {
std::string GetPersonalizableDeviceNameInternal();
#if BUILDFLAG(IS_CHROMEOS)
std::string GetChromeOSDeviceNameFromType();
#endif
LocalDeviceNameInfo::LocalDeviceNameInfo() = default;
LocalDeviceNameInfo::LocalDeviceNameInfo(const LocalDeviceNameInfo& other) =
default;
LocalDeviceNameInfo::~LocalDeviceNameInfo() = default;
namespace {
void OnLocalDeviceNameInfoReady(
base::OnceCallback<void(LocalDeviceNameInfo)> callback,
std::unique_ptr<LocalDeviceNameInfo> name_info) { … }
void OnHardwareInfoReady(LocalDeviceNameInfo* name_info_ptr,
base::ScopedClosureRunner done_closure,
base::SysInfo::HardwareInfo hardware_info) { … }
void OnPersonalizableDeviceNameReady(LocalDeviceNameInfo* name_info_ptr,
base::ScopedClosureRunner done_closure,
std::string personalizable_name) { … }
void OnMachineStatisticsLoaded(LocalDeviceNameInfo* name_info_ptr,
base::ScopedClosureRunner done_closure) { … }
}
sync_pb::SyncEnums::DeviceType GetLocalDeviceType() { … }
DeviceInfo::OsType GetLocalDeviceOSType() { … }
DeviceInfo::FormFactor GetLocalDeviceFormFactor() { … }
std::string GetPersonalizableDeviceNameBlocking() { … }
void GetLocalDeviceNameInfo(
base::OnceCallback<void(LocalDeviceNameInfo)> callback) { … }
}