chromium/chrome/browser/enterprise/signals/device_info_fetcher.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/enterprise/signals/device_info_fetcher.h"

#include "build/build_config.h"

#if BUILDFLAG(IS_MAC)
#include "chrome/browser/enterprise/signals/device_info_fetcher_mac.h"
#elif BUILDFLAG(IS_WIN)
#include "chrome/browser/enterprise/signals/device_info_fetcher_win.h"
#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#include "chrome/browser/enterprise/signals/device_info_fetcher_linux.h"
#endif

namespace enterprise_signals {

namespace {

// When true, will force DeviceInfoFetcher::CreateInstance to return a stubbed
// instance. Used for testing.
bool force_stub_for_testing =;

// Stub implementation of DeviceInfoFetcher.
class StubDeviceFetcher : public DeviceInfoFetcher {};

}  // namespace

DeviceInfo::DeviceInfo() = default;
DeviceInfo::~DeviceInfo() = default;
DeviceInfo::DeviceInfo(const DeviceInfo&) = default;
DeviceInfo::DeviceInfo(DeviceInfo&&) = default;

DeviceInfoFetcher::DeviceInfoFetcher() = default;
DeviceInfoFetcher::~DeviceInfoFetcher() = default;

// static
std::unique_ptr<DeviceInfoFetcher> DeviceInfoFetcher::CreateInstance() {}

#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_WIN) && \
    !(BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS))
// static
std::unique_ptr<DeviceInfoFetcher> DeviceInfoFetcher::CreateInstanceInternal() {
  return std::make_unique<StubDeviceFetcher>();
}
#endif

// static
std::unique_ptr<DeviceInfoFetcher>
DeviceInfoFetcher::CreateStubInstanceForTesting() {}

// static
void DeviceInfoFetcher::SetForceStubForTesting(bool should_force) {}

}  // namespace enterprise_signals