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

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

Issue 2702113006: [DevTools] Full-size screenshots in device mode. (Closed)
Patch Set: Created 3 years, 10 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/DeviceModeWrapper.js
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeWrapper.js b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeWrapper.js
index 0c986301819d394148919759d80983537a6afdb1..54df762fd9b4306d512d0612a29476592a412acf 100644
--- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeWrapper.js
+++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeWrapper.js
@@ -35,6 +35,16 @@ Emulation.DeviceModeWrapper = class extends UI.VBox {
}
/**
+ * @return {boolean}
+ */
+ _captureFullSizeScreenshot() {
+ if (!this._deviceModeView)
+ return false;
+ this._deviceModeView.captureFullSizeScreenshot();
+ return true;
+ }
+
+ /**
* @param {boolean} force
*/
_update(force) {
@@ -76,12 +86,17 @@ Emulation.DeviceModeWrapper.ActionDelegate = class {
*/
handleAction(context, actionId) {
if (Emulation.DeviceModeView._wrapperInstance) {
- if (actionId === 'emulation.toggle-device-mode') {
- Emulation.DeviceModeView._wrapperInstance._toggleDeviceMode();
- return true;
+ switch (actionId) {
+ case 'emulation.capture-screenshot':
+ return Emulation.DeviceModeView._wrapperInstance._captureScreenshot();
+
+ case 'emulation.capture-full-height-screenshot':
+ return Emulation.DeviceModeView._wrapperInstance._captureFullSizeScreenshot();
+
+ case 'emulation.toggle-device-mode':
+ Emulation.DeviceModeView._wrapperInstance._toggleDeviceMode();
+ return true;
}
- if (actionId === 'emulation.capture-screenshot')
- return Emulation.DeviceModeView._wrapperInstance._captureScreenshot();
}
return false;
}

Powered by Google App Engine
This is Rietveld 408576698