Back out ba95fffe62b9 and 564283498a6f for Australis (bug 930970), r=jaws,Unfocused

This commit is contained in:
Gijs Kruitbosch 2013-11-05 10:23:40 +01:00
parent 11d27d3fd0
commit 17f766f166

View File

@ -1287,47 +1287,15 @@ BrowserGlue.prototype = {
_migrateUI: function BG__migrateUI() {
const UI_VERSION = 17;
const BROWSER_DOCURL = "chrome://browser/content/browser.xul#";
let wasCustomizedAndOnAustralis = Services.prefs.prefHasUserValue("browser.uiCustomization.state");
let currentUIVersion = 0;
try {
currentUIVersion = Services.prefs.getIntPref("browser.migration.version");
} catch(ex) {}
if (!wasCustomizedAndOnAustralis && currentUIVersion >= UI_VERSION)
if (currentUIVersion >= UI_VERSION)
return;
this._rdf = Cc["@mozilla.org/rdf/rdf-service;1"].getService(Ci.nsIRDFService);
this._dataSource = this._rdf.GetDataSource("rdf:local-store");
// No version check for this as this code should run until we have Australis everywhere:
if (wasCustomizedAndOnAustralis) {
// This profile's been on australis! If it's missing the back/fwd button
// or go/stop/reload button, then put them back:
let currentsetResource = this._rdf.GetResource("currentset");
let toolbarResource = this._rdf.GetResource(BROWSER_DOCURL + "nav-bar");
let currentset = this._getPersist(toolbarResource, currentsetResource);
if (currentset.indexOf("unified-back-forward-button") == -1) {
currentset = currentset.replace("urlbar-container",
"unified-back-forward-button,urlbar-container");
}
if (currentset.indexOf("reload-button") == -1) {
currentset = currentset.replace("urlbar-container", "urlbar-container,reload-button");
}
if (currentset.indexOf("stop-button") == -1) {
currentset = currentset.replace("reload-button", "reload-button,stop-button");
}
this._setPersist(toolbarResource, currentsetResource, currentset);
Services.prefs.clearUserPref("browser.uiCustomization.state");
// If we don't have anything else to do, we can bail here:
if (currentUIVersion >= UI_VERSION) {
delete this._rdf;
delete this._dataSource;
return;
}
}
this._dirty = false;
if (currentUIVersion < 2) {