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

Unified Diff: third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js

Issue 2431823002: DevTools: device mode devices remember last used zoom (Closed)
Patch Set: rename to device-mode-test Created 4 years, 2 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/devtools/front_end/emulation/DeviceModeModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js
index 8a4ada9a71243febea059befc1c80fbd93e107d3..106ddd5e8abb7ecc50afefdd75b040114f723904 100644
--- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeModel.js
@@ -125,19 +125,20 @@ WebInspector.DeviceModeModel.prototype = {
* @param {!WebInspector.DeviceModeModel.Type} type
* @param {?WebInspector.EmulatedDevice} device
* @param {?WebInspector.EmulatedDevice.Mode} mode
+ * @param {number=} scale
*/
- emulate: function(type, device, mode)
+ emulate: function(type, device, mode, scale)
{
var resetPageScaleFactor = this._type !== type || this._device !== device || this._mode !== mode;
this._type = type;
if (type === WebInspector.DeviceModeModel.Type.Device) {
console.assert(device && mode, "Must pass device and mode for device emulation");
- this._device = device;
this._mode = mode;
+ this._device = device;
if (this._initialized) {
var orientation = device.orientationByName(mode.orientation);
- this._scaleSetting.set(this._calculateFitScale(orientation.width, orientation.height, this._currentOutline(), this._currentInsets()));
+ this._scaleSetting.set(scale || this._calculateFitScale(orientation.width, orientation.height, this._currentOutline(), this._currentInsets()));
}
} else {
this._device = null;

Powered by Google App Engine
This is Rietveld 408576698