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

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

Issue 2837463002: DevTools: allow capturing screenshots from command menu. (Closed)
Patch Set: clean 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
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 04e9011877590f1c69e7b574a105f04b159dad13..3935ae85d3dd2002399f454af404c8e926b84c08 100644
--- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
+++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
@@ -307,6 +307,18 @@ Emulation.DeviceModeView = class extends UI.VBox {
element.classList.toggle('hidden', !success);
}
+ /**
+ * @param {!Element} element
+ */
+ setNonEmulatedAvailableSize(element) {
+ if (this._model.type() !== Emulation.DeviceModeModel.Type.None)
+ return;
+ var zoomFactor = UI.zoomManager.zoomFactor();
+ var rect = element.getBoundingClientRect();
+ var availableSize = new UI.Size(Math.max(rect.width * zoomFactor, 1), Math.max(rect.height * zoomFactor, 1));
+ this._model.setAvailableSize(availableSize, availableSize);
+ }
+
_contentAreaResized() {
var zoomFactor = UI.zoomManager.zoomFactor();
var rect = this._contentArea.getBoundingClientRect();

Powered by Google App Engine
This is Rietveld 408576698