#include "third_party/blink/renderer/core/inspector/dev_tools_emulator.h"
#include <algorithm>
#include "third_party/blink/public/mojom/widget/device_emulation_params.mojom-blink.h"
#include "third_party/blink/public/web/web_settings.h"
#include "third_party/blink/renderer/core/events/web_input_event_conversion.h"
#include "third_party/blink/renderer/core/exported/web_view_impl.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/frame/visual_viewport.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/core/input/event_handler.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/scroll/scrollbar_theme.h"
#include "third_party/blink/renderer/core/style/computed_style.h"
#include "third_party/blink/renderer/platform/loader/fetch/memory_cache.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/wtf/ref_counted.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/geometry/size_f.h"
namespace {
static float calculateDeviceScaleAdjustment(int width,
int height,
float deviceScaleFactor) { … }
}
namespace blink {
class DevToolsEmulator::ScopedGlobalOverrides
: public WTF::RefCounted<ScopedGlobalOverrides> { … };
DevToolsEmulator::ScopedGlobalOverrides*
DevToolsEmulator::ScopedGlobalOverrides::g_instance_ = …;
DevToolsEmulator::DevToolsEmulator(WebViewImpl* web_view)
: … { … }
DevToolsEmulator::~DevToolsEmulator() { … }
void DevToolsEmulator::Trace(Visitor* visitor) const { … }
void DevToolsEmulator::Shutdown() { … }
void DevToolsEmulator::SetTextAutosizingEnabled(bool enabled) { … }
void DevToolsEmulator::SetDeviceScaleAdjustment(float device_scale_adjustment) { … }
void DevToolsEmulator::SetLCDTextPreference(LCDTextPreference preference) { … }
void DevToolsEmulator::SetViewportStyle(mojom::blink::ViewportStyle style) { … }
void DevToolsEmulator::SetPluginsEnabled(bool enabled) { … }
void DevToolsEmulator::SetScriptEnabled(bool enabled) { … }
void DevToolsEmulator::SetHideScrollbars(bool hide) { … }
void DevToolsEmulator::SetCookieEnabled(bool enabled) { … }
void DevToolsEmulator::SetDoubleTapToZoomEnabled(bool enabled) { … }
bool DevToolsEmulator::DoubleTapToZoomEnabled() const { … }
void DevToolsEmulator::SetMainFrameResizesAreOrientationChanges(bool value) { … }
void DevToolsEmulator::SetDefaultPageScaleLimits(float min_scale,
float max_scale) { … }
void DevToolsEmulator::SetShrinksViewportContentToFit(
bool shrink_viewport_content) { … }
void DevToolsEmulator::SetViewportEnabled(bool enabled) { … }
void DevToolsEmulator::SetViewportMetaEnabled(bool enabled) { … }
void DevToolsEmulator::SetAvailablePointerTypes(int types) { … }
void DevToolsEmulator::SetPrimaryPointerType(
mojom::blink::PointerType pointer_type) { … }
void DevToolsEmulator::SetAvailableHoverTypes(int types) { … }
void DevToolsEmulator::SetPrimaryHoverType(mojom::blink::HoverType hover_type) { … }
void DevToolsEmulator::SetOutputDeviceUpdateAbilityType(
mojom::blink::OutputDeviceUpdateAbilityType type) { … }
gfx::Transform DevToolsEmulator::EnableDeviceEmulation(
const DeviceEmulationParams& params) { … }
void DevToolsEmulator::DisableDeviceEmulation() { … }
void DevToolsEmulator::EnableMobileEmulation() { … }
void DevToolsEmulator::DisableMobileEmulation() { … }
gfx::Transform DevToolsEmulator::ForceViewport(const gfx::PointF& position,
float scale) { … }
gfx::Transform DevToolsEmulator::ResetViewport() { … }
gfx::Transform DevToolsEmulator::OutermostMainFrameScrollOrScaleChanged() { … }
void DevToolsEmulator::ApplyViewportOverride(gfx::Transform* transform) { … }
gfx::Transform DevToolsEmulator::ComputeRootLayerTransform() { … }
float DevToolsEmulator::InputEventsScaleForEmulation() { … }
void DevToolsEmulator::SetTouchEventEmulationEnabled(bool enabled,
int max_touch_points) { … }
void DevToolsEmulator::SetScriptExecutionDisabled(
bool script_execution_disabled) { … }
void DevToolsEmulator::SetScrollbarsHidden(bool hidden) { … }
void DevToolsEmulator::SetDocumentCookieDisabled(bool disabled) { … }
void DevToolsEmulator::SetAutoDarkModeOverride(bool enabled) { … }
void DevToolsEmulator::ResetAutoDarkModeOverride() { … }
}