Bug 761023 - [devtb] Developer Toolbar should re-open automatically if browser closed with it open; r=jwalker

This commit is contained in:
Paul Rouget 2012-06-15 15:55:33 +02:00
parent 7953f794f3
commit 8825960da3
3 changed files with 10 additions and 0 deletions

View File

@ -1024,6 +1024,7 @@ pref("devtools.errorconsole.enabled", false);
// Developer toolbar and GCLI preferences
pref("devtools.toolbar.enabled", false);
pref("devtools.toolbar.visible", false);
pref("devtools.gcli.allowSet", false);
// Enable the Inspector

View File

@ -1397,6 +1397,11 @@ var gBrowserInit = {
#ifdef MENUBAR_CAN_AUTOHIDE
document.getElementById("appmenu_devToolbar").hidden = false;
#endif
// Show the toolbar if it was previously visible
if (gPrefService.getBoolPref("devtools.toolbar.visible")) {
this.DeveloperToolbar.show();
}
}
// Enable Inspector?

View File

@ -122,6 +122,8 @@ DeveloperToolbar.prototype.show = function DT_show(aCallback)
return;
}
Services.prefs.setBoolPref("devtools.toolbar.visible", true);
this._notify(NOTIFICATIONS.LOAD);
this._pendingShowCallback = aCallback;
this._pendingHide = false;
@ -281,6 +283,8 @@ DeveloperToolbar.prototype.hide = function DT_hide()
this._element.hidden = true;
Services.prefs.setBoolPref("devtools.toolbar.visible", false);
this._doc.getElementById("Tools:DevToolbar").setAttribute("checked", "false");
this.destroy();