Chromium Code Reviews| Index: third_party/WebKit/Source/web/DevToolsEmulator.h |
| diff --git a/third_party/WebKit/Source/web/DevToolsEmulator.h b/third_party/WebKit/Source/web/DevToolsEmulator.h |
| index 07836526e34fbc6b10560e8bfe291d7ce2486c8d..eecf2e8c701d2c542a35d7c8dda063457bab6e8a 100644 |
| --- a/third_party/WebKit/Source/web/DevToolsEmulator.h |
| +++ b/third_party/WebKit/Source/web/DevToolsEmulator.h |
| @@ -7,19 +7,24 @@ |
| #include "platform/heap/Handle.h" |
| #include "public/platform/PointerProperties.h" |
| +#include "public/platform/WebFloatPoint.h" |
| #include "public/platform/WebViewportStyle.h" |
| #include "public/web/WebDeviceEmulationParams.h" |
| +#include "web/WebExport.h" |
| #include "wtf/Forward.h" |
| +#include "wtf/Optional.h" |
| #include <memory> |
| namespace blink { |
| class InspectorEmulationAgent; |
| class IntPoint; |
| +class IntRect; |
| +class TransformationMatrix; |
| class WebInputEvent; |
| class WebViewImpl; |
| -class DevToolsEmulator final : public GarbageCollectedFinalized<DevToolsEmulator> { |
| +class WEB_EXPORT DevToolsEmulator final : public GarbageCollectedFinalized<DevToolsEmulator> { |
| public: |
| ~DevToolsEmulator(); |
| static DevToolsEmulator* create(WebViewImpl*); |
| @@ -44,23 +49,44 @@ public: |
| // Emulation. |
| void enableDeviceEmulation(const WebDeviceEmulationParams&); |
| void disableDeviceEmulation(); |
| + void forceViewport(const WebFloatPoint& position, float scale); |
|
chrishtr
2016/08/22 22:00:42
Scale after position, or before? Units for positio
Eric Seckler
2016/08/23 09:32:19
Units are documented in the corresponding protocol
|
| + void resetViewport(); |
| bool resizeIsDeviceSizeChange(); |
| void setTouchEventEmulationEnabled(bool); |
| bool handleInputEvent(const WebInputEvent&); |
| void setScriptExecutionDisabled(bool); |
| + // Notify the DevToolsEmulator about a scroll or scale change of the main |
| + // frame. Updates the transform for a viewport override. |
| + void mainFrameScrollOrScaleChanged(); |
| + |
| + // Returns a custom visible content rect if a viewport override is active. |
| + // This ensures that all content inside the forced viewport is painted. |
| + WTF::Optional<IntRect> visibleContentRectForPainting() const; |
| + |
| private: |
| explicit DevToolsEmulator(WebViewImpl*); |
| void enableMobileEmulation(); |
| void disableMobileEmulation(); |
| + void applyDeviceEmulationTransform(TransformationMatrix*); |
| + void applyViewportOverride(TransformationMatrix*); |
| + void updateRootLayerTransform(); |
| + |
| WebViewImpl* m_webViewImpl; |
| bool m_deviceMetricsEnabled; |
| bool m_emulateMobileEnabled; |
| WebDeviceEmulationParams m_emulationParams; |
| + struct ViewportOverride { |
| + WebFloatPoint position; |
| + double scale; |
| + bool originalVisualViewportMasking; |
| + }; |
| + WTF::Optional<ViewportOverride> m_viewportOverride; |
| + |
| bool m_isOverlayScrollbarsEnabled; |
| bool m_isOrientationEventEnabled; |
| bool m_isMobileLayoutThemeEnabled; |