| Index: third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
|
| index 47ce70d66b4e49e382ca616bb0df84255b9def02..c4447ec2a45710e7c9e202ce94abcd7b93f35e92 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
|
| @@ -380,6 +380,17 @@ WebInspector.DeviceModeView.prototype = {
|
| var mainTarget = WebInspector.targetManager.mainTarget();
|
| if (!mainTarget)
|
| return;
|
| + WebInspector.DOMModel.muteHighlight();
|
| +
|
| + var zoomFactor = WebInspector.zoomManager.zoomFactor();
|
| + var rect = this._contentArea.getBoundingClientRect();
|
| + var availableSize = new Size(Math.max(rect.width * zoomFactor, 1), Math.max(rect.height * zoomFactor, 1));
|
| +
|
| + if (availableSize.width < this._model.screenRect().width ||
|
| + availableSize.height < this._model.screenRect().height) {
|
| + WebInspector.inspectorView.minimize();
|
| + }
|
| +
|
| mainTarget.pageAgent().captureScreenshot(screenshotCaptured.bind(this));
|
|
|
| /**
|
| @@ -389,8 +400,11 @@ WebInspector.DeviceModeView.prototype = {
|
| */
|
| function screenshotCaptured(error, content)
|
| {
|
| - if (error)
|
| + if (error) {
|
| + WebInspector.DOMModel.unmuteHighlight();
|
| + WebInspector.inspectorView.restore();
|
| return;
|
| + }
|
|
|
| // Create a canvas to splice the images together.
|
| var canvas = createElement("canvas");
|
| @@ -441,6 +455,8 @@ WebInspector.DeviceModeView.prototype = {
|
| link.download = fileName + ".png";
|
| link.href = canvas.toDataURL("image/png");
|
| link.click();
|
| + WebInspector.DOMModel.unmuteHighlight();
|
| + WebInspector.inspectorView.restore();
|
| }
|
| }
|
| },
|
|
|