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

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

Issue 1939803002: DevTools: mute the node highlight & hide devtools while taking screenshots. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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();
}
}
},

Powered by Google App Engine
This is Rietveld 408576698