Web Inspector: show the device settings menu when Web Inspector's debug mode is enabled
https://bugs.webkit.org/show_bug.cgi?id=206311

Reviewed by Brian Burg.

This only has an effect when Web Inspector is opened and the debug mode is enabled. If so,
the device settings toolbar icon will appear regardless of whether the inspected target is
a remote device or not. Disabling debug mode will not immediately remove the device settings
toolbar icon, but it will not reappear when Web Inspector is next opened (to allow for taking
screenshots and other such things).

* UserInterface/Base/Main.js:
(WI.contentLoaded):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@254727 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog
index 42e7b78..1bdfefb 100644
--- a/Source/WebInspectorUI/ChangeLog
+++ b/Source/WebInspectorUI/ChangeLog
@@ -1,3 +1,19 @@
+2020-01-16  Devin Rousso  <drousso@apple.com>
+
+        Web Inspector: show the device settings menu when Web Inspector's debug mode is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=206311
+
+        Reviewed by Brian Burg.
+
+        This only has an effect when Web Inspector is opened and the debug mode is enabled. If so,
+        the device settings toolbar icon will appear regardless of whether the inspected target is
+        a remote device or not. Disabling debug mode will not immediately remove the device settings
+        toolbar icon, but it will not reappear when Web Inspector is next opened (to allow for taking
+        screenshots and other such things).
+
+        * UserInterface/Base/Main.js:
+        (WI.contentLoaded):
+
 2020-01-16  Nikita Vasilyev  <nvasilyev@apple.com>
 
         REGRESSION(r251487): Web Inspector: selected color in color picker has wrong lightness
diff --git a/Source/WebInspectorUI/UserInterface/Base/Main.js b/Source/WebInspectorUI/UserInterface/Base/Main.js
index ff22801..71650d3 100644
--- a/Source/WebInspectorUI/UserInterface/Base/Main.js
+++ b/Source/WebInspectorUI/UserInterface/Base/Main.js
@@ -400,7 +400,7 @@
     WI._inspectModeToolbarButton.addEventListener(WI.ButtonNavigationItem.Event.Clicked, WI._toggleInspectMode);
 
     // COMPATIBILITY (iOS 12.2): Page.overrideSetting did not exist.
-    if (InspectorFrontendHost.isRemote && InspectorBackend.hasCommand("Page.overrideUserAgent") && InspectorBackend.hasCommand("Page.overrideSetting")) {
+    if ((InspectorFrontendHost.isRemote || WI.isDebugUIEnabled()) && InspectorBackend.hasCommand("Page.overrideUserAgent") && InspectorBackend.hasCommand("Page.overrideSetting")) {
         const deviceSettingsTooltip = WI.UIString("Device Settings");
         WI._deviceSettingsToolbarButton = new WI.ActivateButtonToolbarItem("device-settings", deviceSettingsTooltip, deviceSettingsTooltip, "Images/Device.svg");
         WI._deviceSettingsToolbarButton.addEventListener(WI.ButtonNavigationItem.Event.Clicked, WI._handleDeviceSettingsToolbarButtonClicked);