Bug 960047 - Reset Sync promobox count for bookmark/add-on/passwords panels. r=gavin

This commit is contained in:
Marco Bonardo 2014-03-12 23:30:41 +01:00
parent c05e7c3894
commit 64661159ae
2 changed files with 10 additions and 15 deletions

View File

@ -2055,21 +2055,10 @@
</field>
<property name="_viewsLeftMap">
<getter><![CDATA[
let viewsLeftMap = {};
try {
viewsLeftMap = JSON.parse(Services.prefs.getCharPref("browser.syncPromoViewsLeftMap"));
} catch (ex) {
// If the old preference exists, migrate it to the new one.
try {
let oldPref = Services.prefs.getIntPref("browser.syncPromoViewsLeft");
Services.prefs.clearUserPref("browser.syncPromoViewsLeft");
viewsLeftMap.bookmarks = oldPref;
viewsLeftMap.passwords = oldPref;
Services.prefs.setCharPref("browser.syncPromoViewsLeftMap",
JSON.stringify(viewsLeftMap));
} catch (ex2) {}
}
return viewsLeftMap;
return JSON.parse(Services.prefs.getCharPref("browser.syncPromoViewsLeftMap"));
} catch (ex) {}
return {};
]]></getter>
</property>
<property name="_viewsLeft">

View File

@ -1292,7 +1292,7 @@ BrowserGlue.prototype = {
},
_migrateUI: function BG__migrateUI() {
const UI_VERSION = 21;
const UI_VERSION = 22;
const BROWSER_DOCURL = "chrome://browser/content/browser.xul#";
let currentUIVersion = 0;
try {
@ -1574,6 +1574,12 @@ BrowserGlue.prototype = {
}
}
if (currentUIVersion < 22) {
// Reset the Sync promobox count to promote the new FxAccount-based Sync.
Services.prefs.clearUserPref("browser.syncPromoViewsLeft");
Services.prefs.clearUserPref("browser.syncPromoViewsLeftMap");
}
if (this._dirty)
this._dataSource.QueryInterface(Ci.nsIRDFRemoteDataSource).Flush();