Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1194)

Unified Diff: third_party/WebKit/Source/web/DevToolsEmulator.h

Issue 2237433004: Adds DevTools commands for forced viewport override. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unique_ptr -> Optional. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..f8a9d3ea21f7264ea6edf02fce8ec06a1038f7a6 100644
--- a/third_party/WebKit/Source/web/DevToolsEmulator.h
+++ b/third_party/WebKit/Source/web/DevToolsEmulator.h
@@ -7,15 +7,19 @@
#include "platform/heap/Handle.h"
#include "public/platform/PointerProperties.h"
+#include "public/platform/WebFloatRect.h"
#include "public/platform/WebViewportStyle.h"
#include "public/web/WebDeviceEmulationParams.h"
#include "wtf/Forward.h"
+#include "wtf/Optional.h"
#include <memory>
namespace blink {
class InspectorEmulationAgent;
class IntPoint;
+class TransformationMatrix;
+struct WebFloatRect;
class WebInputEvent;
class WebViewImpl;
@@ -44,23 +48,40 @@ public:
// Emulation.
void enableDeviceEmulation(const WebDeviceEmulationParams&);
void disableDeviceEmulation();
+ void setVisualTransformOverride(const WebFloatRect& area, float scale);
+ void clearVisualTransformOverride();
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 an visual transform override.
+ void mainFrameScrollOrScaleChanged();
+
private:
explicit DevToolsEmulator(WebViewImpl*);
void enableMobileEmulation();
void disableMobileEmulation();
+ void applyDeviceEmulationTransform(TransformationMatrix*);
+ void applyVisualTransformOverride(TransformationMatrix*);
+ void updateRootLayerTransform();
+
WebViewImpl* m_webViewImpl;
bool m_deviceMetricsEnabled;
bool m_emulateMobileEnabled;
WebDeviceEmulationParams m_emulationParams;
+ struct VisualTransformOverride {
+ WebFloatRect area;
+ double scale;
+ bool originalVisualViewportMasking;
+ };
+ WTF::Optional<VisualTransformOverride> m_visualTransformOverride;
+
bool m_isOverlayScrollbarsEnabled;
bool m_isOrientationEventEnabled;
bool m_isMobileLayoutThemeEnabled;

Powered by Google App Engine
This is Rietveld 408576698