| 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 656d38285fb3b038dadb75efac26d6da16504e5a..b0ae7476359342bee0b16b25ad4f519a137ef785 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
|
| @@ -470,6 +470,35 @@ Emulation.DeviceModeView = class extends UI.VBox {
|
| }
|
| }
|
| }
|
| +
|
| + captureFullSizeScreenshot() {
|
| + SDK.DOMModel.muteHighlight();
|
| + this._model.captureFullSizeScreenshot(content => {
|
| + SDK.DOMModel.unmuteHighlight();
|
| + if (content === null)
|
| + return;
|
| + var canvas = createElement('canvas');
|
| + var pageImage = new Image();
|
| + pageImage.src = 'data:image/png;base64,' + content;
|
| + pageImage.onload = () => {
|
| + var ctx = canvas.getContext('2d');
|
| + ctx.imageSmoothingEnabled = false;
|
| + canvas.width = pageImage.width;
|
| + canvas.height = pageImage.height;
|
| + ctx.drawImage(pageImage, 0, 0);
|
| + var url = this._model.target() && this._model.target().inspectedURL();
|
| + var fileName = url ? url.trimURL().removeURLFragment() : '';
|
| + if (this._model.type() === Emulation.DeviceModeModel.Type.Device)
|
| + fileName += Common.UIString('(%s)', this._model.device().title);
|
| + var link = createElement('a');
|
| + link.download = fileName + '.png';
|
| + canvas.toBlob(function(blob) {
|
| + link.href = URL.createObjectURL(blob);
|
| + link.click();
|
| + });
|
| + };
|
| + });
|
| + }
|
| };
|
|
|
| /**
|
|
|