Bug 1447528 - Remove the pref observer for the split rule view pref in the inspector. r=pbro
MozReview-Commit-ID: HhOg21levyH
--- a/devtools/client/inspector/inspector.js
+++ b/devtools/client/inspector/inspector.js
@@ -132,20 +132,18 @@ function Inspector(toolbox) {
this.onPanelWindowResize = this.onPanelWindowResize.bind(this);
this.onShowBoxModelHighlighterForNode =
this.onShowBoxModelHighlighterForNode.bind(this);
this.onSidebarHidden = this.onSidebarHidden.bind(this);
this.onSidebarResized = this.onSidebarResized.bind(this);
this.onSidebarSelect = this.onSidebarSelect.bind(this);
this.onSidebarShown = this.onSidebarShown.bind(this);
this.onSidebarToggle = this.onSidebarToggle.bind(this);
- this.onSplitRuleViewPrefChanged = this.onSplitRuleViewPrefChanged.bind(this);
this._target.on("will-navigate", this._onBeforeNavigate);
- this.prefsObserver.on(SPLIT_RULE_VIEW_PREF, this.onSplitRuleViewPrefChanged);
}
Inspector.prototype = {
/**
* open is effectively an asynchronous constructor
*/
init: Task.async(function* () {
// Localize all the nodes containing a data-localization attribute.
@@ -580,24 +578,16 @@ Inspector.prototype = {
this.splitBox.setState({ width, height });
this.sidebarSplitBox.setState({ width: splitSidebarWidth });
},
onSidebarToggle: function() {
Services.prefs.setBoolPref(SPLIT_RULE_VIEW_PREF, !this.isSplitRuleViewEnabled);
},
- async onSplitRuleViewPrefChanged() {
- // Update the stored value of the split rule view preference since it changed.
- this.isSplitRuleViewEnabled = Services.prefs.getBoolPref(SPLIT_RULE_VIEW_PREF);
-
- await this.setupToolbar();
- await this.addRuleView();
- },
-
/**
* Adds the rule view to the main or split sidebar depending on whether or not it is
* split view mode. The default tab specifies whether or not the rule view should be
* selected. The defaultTab defaults to the rule view when the rule view is being merged
* back into the sidebar from the split sidebar. Otherwise, we specify the default tab
* when handling the sidebar setup.
*
* @params {String} defaultTab
@@ -1273,17 +1263,16 @@ Inspector.prototype = {
if (this.walker) {
this.walker.off("new-root", this.onNewRoot);
this.pageStyle = null;
}
this.cancelUpdate();
- this.prefsObserver.off(SPLIT_RULE_VIEW_PREF, this.onSplitRuleViewPrefChanged);
this.target.off("will-navigate", this._onBeforeNavigate);
this.target.off("thread-paused", this.updateDebuggerPausedWarning);
this.target.off("thread-resumed", this.updateDebuggerPausedWarning);
this._toolbox.off("select", this.updateDebuggerPausedWarning);
for (let [, panel] of this._panels) {
panel.destroy();
}