#include "chrome/test/chromedriver/chrome/mobile_emulation_override_manager.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "chrome/test/chromedriver/chrome/device_metrics.h"
#include "chrome/test/chromedriver/chrome/devtools_client.h"
#include "chrome/test/chromedriver/chrome/status.h"
namespace {
Status OverrideDeviceMetricsIfNeeded(DevToolsClient* client,
const MobileDevice& mobile_device) { … }
Status OverrideClientHintsIfNeeded(DevToolsClient* client,
const MobileDevice& mobile_device,
int major_version) { … }
}
MobileEmulationOverrideManager::MobileEmulationOverrideManager(
DevToolsClient* client,
std::optional<MobileDevice> mobile_device,
int browser_major_version)
: … { … }
MobileEmulationOverrideManager::~MobileEmulationOverrideManager() = default;
Status MobileEmulationOverrideManager::OnConnected(DevToolsClient* client) { … }
Status MobileEmulationOverrideManager::OnEvent(
DevToolsClient* client,
const std::string& method,
const base::Value::Dict& params) { … }
bool MobileEmulationOverrideManager::IsEmulatingTouch() const { … }
bool MobileEmulationOverrideManager::HasOverrideMetrics() const { … }
Status MobileEmulationOverrideManager::RestoreOverrideMetrics() { … }
const DeviceMetrics* MobileEmulationOverrideManager::GetDeviceMetrics() const { … }
Status MobileEmulationOverrideManager::ApplyOverrideIfNeeded() { … }