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

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: Created 4 years, 11 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 2ec229c2836f9d0c94bfdd84bde9e29733fe18d4..91a6a0b362e982c81dfe3345a4a2c4b71419d472 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();
@@ -240,6 +242,9 @@ 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);
+ if (this._model.outlineImage()) {
dgozman 2016/02/01 17:18:27 Instead oh hiding, disable the item (last paramete
mmccoy 2016/02/10 20:06:33 Done.
+ contextMenu.appendCheckboxItem(WebInspector.UIString("Show device frame"), this._toggleOutline.bind(this), this._showOutlineSetting.get(), this._model.type() === WebInspector.DeviceModeModel.Type.None);
+ };
contextMenu.appendItem(WebInspector.UIString("Configure network\u2026"), this._openNetworkConfig.bind(this), false);
contextMenu.appendItemsAtLocation("deviceModeMenu");
},
@@ -254,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