#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 {
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) { … }
}
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) { … }
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 { … }