chromium/chrome/test/chromedriver/chrome/mobile_device.cc

// Copyright 2014 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/test/chromedriver/chrome/mobile_device.h"

#include <memory>
#include <string_view>
#include <utility>

#include "base/json/json_reader.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "chrome/test/chromedriver/chrome/client_hints.h"
#include "chrome/test/chromedriver/chrome/mobile_device_list.h"
#include "chrome/test/chromedriver/chrome/status.h"

namespace {

// The values are taken from GetUnifiedPlatform() function
// in content/common/user_agent.cc file
const char kAndroidUnifiedPlatformName[] =;
const char kChromeOSUnifiedPlatformName[] =;
const char kMacOSUnifiedPlatformName[] =;
const char kWindowsUnifiedPlatformName[] =;
const char kFuchsiaUnifiedPlatformName[] =;
const char kLinuxUnifiedPlatformName[] =;
const char kFrozenUserAgentTemplate[] =;

struct Platform {};

Platform kAndroidPlatform{};

Platform kChromeOSPlatform{};

Platform kChromiumOSPlatform{};

Platform kMacOSPlatform{};

Platform kWindowsPlatform{};

Platform kFuchsiaPlatform{};

Platform kLinuxPlatform{};

const Platform* kPlatformsWithReducedUserAgentSupport[] =;

Status ParsePresetDeviceMetrics(const base::Value::Dict& device_metrics_dict,
                                DeviceMetrics* device_metrics) {}

Status ParsePresetClientHints(const base::Value::Dict& client_hints_dict,
                              ClientHints* client_hints) {}

}  // namespace

MobileDevice::MobileDevice() = default;
MobileDevice::MobileDevice(const MobileDevice&) = default;
MobileDevice::~MobileDevice() = default;
MobileDevice& MobileDevice::operator=(const MobileDevice&) = default;

Status MobileDevice::FindMobileDevice(std::string device_name,
                                      MobileDevice* mobile_device) {}

Status MobileDevice::GetKnownMobileDeviceNamesForTesting(
    std::vector<std::string>* result) {}

// The idea is borrowed from
// https://developer.chrome.com/docs/privacy-sandbox/user-agent/snippets/
bool MobileDevice::GuessPlatform(const std::string& user_agent,
                                 std::string* platform) {}

std::vector<std::string> MobileDevice::GetReducedUserAgentPlatforms() {}

Status MobileDevice::GetReducedUserAgent(
    std::string major_version,
    std::string* reduced_user_agent) const {}