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

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

Issue 1650243004: [DevTools] Option to show device frames in emulation mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Positioning and context menu fixes, addressing review comments Created 4 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/DeviceModeToolbar.js
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeToolbar.js b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeToolbar.js
index cfce4c79d1abc9a2fe97a1227fa7d164f28d69ce..c7672215bed6e56b4233e2abb6d25c4fc979eb10 100644
--- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeToolbar.js
+++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeToolbar.js
@@ -6,13 +6,15 @@
* @param {!WebInspector.DeviceModeModel} model
* @param {!WebInspector.Setting} showMediaInspectorSetting
* @param {!WebInspector.Setting} showRulersSetting
+ * @param {!WebInspector.Setting} showOutlineSetting
* @constructor
*/
-WebInspector.DeviceModeToolbar = function(model, showMediaInspectorSetting, showRulersSetting)
+WebInspector.DeviceModeToolbar = function(model, showMediaInspectorSetting, showRulersSetting, showOutlineSetting)
{
this._model = model;
this._showMediaInspectorSetting = showMediaInspectorSetting;
this._showRulersSetting = showRulersSetting;
+ this._showOutlineSetting = showOutlineSetting;
/** @type {!Map<!WebInspector.EmulatedDevice, !WebInspector.EmulatedDevice.Mode>} */
this._lastMode = new Map();
@@ -242,6 +244,7 @@ WebInspector.DeviceModeToolbar.prototype = {
contextMenu.appendCheckboxItem(WebInspector.UIString("Show media queries"), this._toggleMediaInspector.bind(this), this._showMediaInspectorSetting.get(), this._model.type() === WebInspector.DeviceModeModel.Type.None);
contextMenu.appendCheckboxItem(WebInspector.UIString("Show rulers"), this._toggleRulers.bind(this), this._showRulersSetting.get(), this._model.type() === WebInspector.DeviceModeModel.Type.None);
+ contextMenu.appendCheckboxItem(WebInspector.UIString("Show device frame"), this._toggleOutline.bind(this), (this._showOutlineSetting.get() && this._model.outlineImage() !== ""), !this._model.outlineImage());
contextMenu.appendItem(WebInspector.UIString("Configure network\u2026"), this._openNetworkConfig.bind(this), false);
contextMenu.appendItemsAtLocation("deviceModeMenu");
},
@@ -256,6 +259,11 @@ WebInspector.DeviceModeToolbar.prototype = {
this._showRulersSetting.set(!this._showRulersSetting.get());
},
+ _toggleOutline: function()
+ {
+ this._showOutlineSetting.set(!this._showOutlineSetting.get());
+ },
+
_openNetworkConfig: function()
{
InspectorFrontendHost.bringToFront();

Powered by Google App Engine
This is Rietveld 408576698