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

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

Issue 1840533002: Devtools: Add screenshot button to device mode toolbar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaselined again Created 4 years, 9 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 2fca7229288837bfeeef2ccd7dfc9b9b339a1708..f1cfe7f1c79a44a681a1dcfb0718064c65a5a039 100644
--- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeWrapper.js
+++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeWrapper.js
@@ -30,6 +30,17 @@ WebInspector.DeviceModeWrapper.prototype = {
},
/**
+ * @return {boolean}
+ */
+ _captureScreenshot: function()
+ {
+ if (!this._deviceModeView)
+ return false;
+ this._deviceModeView.captureScreenshot();
+ return true;
+ },
+
+ /**
* @param {boolean} force
*/
_update: function(force)
@@ -80,6 +91,8 @@ WebInspector.DeviceModeWrapper.ActionDelegate.prototype = {
WebInspector.DeviceModeView._wrapperInstance._toggleDeviceMode();
return true;
}
+ if (actionId === "emulation.capture-screenshot")
+ return WebInspector.DeviceModeView._wrapperInstance._captureScreenshot();
}
return false;
}

Powered by Google App Engine
This is Rietveld 408576698