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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/EmulationModel.js

Issue 2844383003: [DevTools] Move the rest of emulation to EmulationModel (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/sdk/EmulationModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/EmulationModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/EmulationModel.js
index f06668f93542787851cceb839e5b6d80b66343cb..51d51cb4d461702db64d093bd6e7fbd39bab237a 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/EmulationModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/EmulationModel.js
@@ -36,6 +36,51 @@ SDK.EmulationModel = class extends SDK.SDKModel {
}
/**
+ * @return {!Promise}
+ */
+ resetPageScaleFactor() {
+ return this._emulationAgent.resetPageScaleFactor();
+ }
+
+ /**
+ * @param {?Protocol.PageAgent.SetDeviceMetricsOverrideRequest} metrics
+ * @return {!Promise}
+ */
+ emulateDevice(metrics) {
+ if (metrics)
+ return this._emulationAgent.invoke_setDeviceMetricsOverride(metrics);
+ else
+ return this._emulationAgent.clearDeviceMetricsOverride();
+ }
+
+ /**
+ * @param {number} width
+ * @param {number} height
+ * @return {!Promise}
+ */
+ setVisibleSize(width, height) {
+ return this._emulationAgent.setVisibleSize(width, height);
+ }
+
+ /**
+ * @param {{x: number, y: number, scale: number}|null} viewport
+ * @return {!Promise}
+ */
+ forceViewport(viewport) {
+ if (viewport)
+ return this._emulationAgent.forceViewport(viewport.x, viewport.y, viewport.scale);
+ else
+ return this._emulationAgent.resetViewport();
+ }
+
+ /**
+ * @return {?SDK.OverlayModel}
+ */
+ overlayModel() {
+ return this._overlayModel;
+ }
+
+ /**
* @param {?SDK.EmulationModel.Geolocation} geolocation
*/
emulateGeolocation(geolocation) {
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698