Bug 1462451 - Remove checks for the 3 pane toggle button. r=jryans
MozReview-Commit-ID: DrJXI0cJYz5
--- a/devtools/client/inspector/inspector.js
+++ b/devtools/client/inspector/inspector.js
@@ -50,17 +50,16 @@ const INITIAL_SIDEBAR_SIZE = 350;
// automatically switches from 'landscape/horizontal' to 'portrait/vertical' mode.
const PORTRAIT_MODE_WIDTH_THRESHOLD = 700;
// If the toolbox's width docked to the side is smaller than the given amount of pixels,
// the sidebar automatically switches from 'landscape/horizontal' to 'portrait/vertical'
// mode.
const SIDE_PORTAIT_MODE_WIDTH_THRESHOLD = 1000;
const SHOW_THREE_PANE_ONBOARDING_PREF = "devtools.inspector.show-three-pane-tooltip";
-const SHOW_THREE_PANE_TOGGLE_PREF = "devtools.inspector.three-pane-toggle";
const THREE_PANE_ENABLED_PREF = "devtools.inspector.three-pane-enabled";
const THREE_PANE_ENABLED_SCALAR = "devtools.inspector.three_pane_enabled";
/**
* Represents an open instance of the Inspector for a tab.
* The inspector controls the breadcrumbs, the markup view, and the sidebar
* (computed view, rule view, font view and animation inspector).
*
@@ -115,17 +114,16 @@ function Inspector(toolbox) {
this.reflowTracker = new ReflowTracker(this._target);
this.styleChangeTracker = new InspectorStyleChangeTracker(this);
// Store the URL of the target page prior to navigation in order to ensure
// telemetry counts in the Grid Inspector are not double counted on reload.
this.previousURL = this.target.url;
this.is3PaneModeEnabled = Services.prefs.getBoolPref(THREE_PANE_ENABLED_PREF);
- this.show3PaneToggle = Services.prefs.getBoolPref(SHOW_THREE_PANE_TOGGLE_PREF);
this.show3PaneTooltip = Services.prefs.getBoolPref(SHOW_THREE_PANE_ONBOARDING_PREF);
this.nodeMenuTriggerInfo = null;
this._clearSearchResultsLabel = this._clearSearchResultsLabel.bind(this);
this._handleRejectionIfNotDestroyed = this._handleRejectionIfNotDestroyed.bind(this);
this._onBeforeNavigate = this._onBeforeNavigate.bind(this);
this._onContextMenu = this._onContextMenu.bind(this);
@@ -771,25 +769,24 @@ Inspector.prototype = {
return panel;
},
/**
* Build the sidebar.
*/
async setupSidebar() {
let sidebar = this.panelDoc.getElementById("inspector-sidebar");
- let options = { showAllTabsMenu: true };
-
- if (this.show3PaneToggle) {
- options.sidebarToggleButton = {
+ let options = {
+ showAllTabsMenu: true,
+ sidebarToggleButton: {
collapsed: !this.is3PaneModeEnabled,
collapsePaneTitle: INSPECTOR_L10N.getStr("inspector.hideThreePaneMode"),
expandPaneTitle: INSPECTOR_L10N.getStr("inspector.showThreePaneMode"),
onClick: this.onSidebarToggle,
- };
+ }
}
this.sidebar = new ToolSidebar(sidebar, this, "inspector", options);
let ruleSideBar = this.panelDoc.getElementById("inspector-rules-sidebar");
this.ruleViewSideBar = new ToolSidebar(ruleSideBar, this, "inspector", {
hideTabstripe: true
});
@@ -801,25 +798,16 @@ Inspector.prototype = {
if (this.is3PaneModeEnabled && defaultTab === "ruleview") {
defaultTab = "computedview";
}
// Append all side panels
await this.addRuleView(defaultTab);
- // If the 3 Pane Inspector feature is disabled, use the old order:
- // Rules, Computed, Layout, etc.
- if (!this.show3PaneToggle) {
- this.sidebar.addExistingTab(
- "computedview",
- INSPECTOR_L10N.getStr("inspector.sidebar.computedViewTitle"),
- defaultTab == "computedview");
- }
-
// Inject a lazy loaded react tab by exposing a fake React object
// with a lazy defined Tab thanks to `panel` being a function
let layoutId = "layoutview";
let layoutTitle = INSPECTOR_L10N.getStr("inspector.sidebar.layoutViewTitle2");
this.sidebar.addTab(
layoutId,
layoutTitle,
{
@@ -834,24 +822,20 @@ Inspector.prototype = {
this.layoutview = new LayoutView(this, this.panelWin);
}
return this.layoutview.provider;
}
},
defaultTab == layoutId);
- // If the 3 Pane Inspector feature is enabled, use the new order:
- // Rules, Layout, Computed, etc.
- if (this.show3PaneToggle) {
- this.sidebar.addExistingTab(
- "computedview",
- INSPECTOR_L10N.getStr("inspector.sidebar.computedViewTitle"),
- defaultTab == "computedview");
- }
+ this.sidebar.addExistingTab(
+ "computedview",
+ INSPECTOR_L10N.getStr("inspector.sidebar.computedViewTitle"),
+ defaultTab == "computedview");
const animationTitle =
INSPECTOR_L10N.getStr("inspector.sidebar.animationInspectorTitle");
if (Services.prefs.getBoolPref("devtools.new-animationinspector.enabled")) {
const animationId = "newanimationinspector";
this.sidebar.addTab(
@@ -1350,17 +1334,16 @@ Inspector.prototype = {
this.highlighters = null;
this.is3PaneModeEnabled = null;
this.panelDoc = null;
this.panelWin.inspector = null;
this.panelWin = null;
this.resultsLength = null;
this.search = null;
this.searchBox = null;
- this.show3PaneToggle = null;
this.show3PaneTooltip = null;
this.sidebar = null;
this.store = null;
this.telemetry = null;
this.threePaneTooltip = null;
this._panelDestroyer = promise.all([
highlighterDestroyer,
--- a/devtools/client/preferences/devtools-client.js
+++ b/devtools/client/preferences/devtools-client.js
@@ -50,22 +50,19 @@ pref("devtools.inspector.enabled", true)
pref("devtools.inspector.activeSidebar", "ruleview");
pref("devtools.inspector.remote", false);
#if defined(NIGHTLY_BUILD)
// Show the 3 pane onboarding tooltip in the inspector
pref("devtools.inspector.show-three-pane-tooltip", true);
// Enable the 3 pane mode in the inspector
pref("devtools.inspector.three-pane-enabled", true);
-// Enable the 3 pane mode toggle in the inspector
-pref("devtools.inspector.three-pane-toggle", true);
#else
pref("devtools.inspector.show-three-pane-tooltip", false);
pref("devtools.inspector.three-pane-enabled", false);
-pref("devtools.inspector.three-pane-toggle", false);
#endif
// Collapse pseudo-elements by default in the rule-view
pref("devtools.inspector.show_pseudo_elements", false);
// The default size for image preview tooltips in the rule-view/computed-view/markup-view
pref("devtools.inspector.imagePreviewTooltipSize", 300);
// Enable user agent style inspection in rule-view
pref("devtools.inspector.showUserAgentStyles", false);
--- a/devtools/client/shared/test/shared-head.js
+++ b/devtools/client/shared/test/shared-head.js
@@ -107,22 +107,20 @@ function loadFrameScriptUtils(browser =
mm.loadFrameScript(frameURL, false);
SimpleTest.registerCleanupFunction(() => {
mm = null;
});
return mm;
}
Services.prefs.setBoolPref("devtools.inspector.three-pane-enabled", true);
-Services.prefs.setBoolPref("devtools.inspector.three-pane-toggle", true);
Services.prefs.setBoolPref("devtools.inspector.show-three-pane-tooltip", false);
registerCleanupFunction(() => {
Services.prefs.clearUserPref("devtools.dump.emit");
Services.prefs.clearUserPref("devtools.inspector.three-pane-enabled");
- Services.prefs.clearUserPref("devtools.inspector.three-pane-toggle");
Services.prefs.clearUserPref("devtools.inspector.show-three-pane-tooltip");
Services.prefs.clearUserPref("devtools.toolbox.host");
Services.prefs.clearUserPref("devtools.toolbox.previousHost");
Services.prefs.clearUserPref("devtools.toolbox.splitconsoleEnabled");
Services.prefs.clearUserPref("devtools.toolbox.splitconsoleHeight");
});
registerCleanupFunction(async function cleanup() {