Bug 959990 - Add Firefox Accounts specific TOS and PP prefs and have utils functions open them if appropriate. r=rnewman.

This commit is contained in:
Mark Hammond 2014-01-28 17:51:08 -08:00
parent 65cd6fcfae
commit 32a861c076
2 changed files with 14 additions and 2 deletions

View File

@ -14,6 +14,13 @@ let gSyncUtils = {
return this.bundle = Services.strings.createBundle("chrome://browser/locale/syncSetup.properties");
},
get fxAccountsEnabled() {
let service = Components.classes["@mozilla.org/weave/service;1"]
.getService(Components.interfaces.nsISupports)
.wrappedJSObject;
return service.fxAccountsEnabled;
},
// opens in a new window if we're in a modal prefwindow world, in a new tab otherwise
_openLink: function (url) {
let thisDocEl = document.documentElement,
@ -71,11 +78,13 @@ let gSyncUtils = {
},
openToS: function () {
this._openLink(Weave.Svc.Prefs.get("termsURL"));
let root = this.fxAccountsEnabled ? "fxa." : "";
this._openLink(Weave.Svc.Prefs.get(root + "termsURL"));
},
openPrivacyPolicy: function () {
this._openLink(Weave.Svc.Prefs.get("privacyURL"));
let root = this.fxAccountsEnabled ? "fxa." : "";
this._openLink(Weave.Svc.Prefs.get(root + "privacyURL"));
},
openFirstSyncProgressPage: function () {

View File

@ -73,3 +73,6 @@ pref("services.sync.log.logger.userapi", "Debug");
pref("services.sync.log.cryptoDebug", false);
pref("services.sync.tokenServerURI", "http://auth.oldsync.dev.lcip.org/1.0/sync/1.1");
pref("services.sync.fxa.termsURL", "https://accounts.firefox.com/legal/terms");
pref("services.sync.fxa.privacyURL", "https://accounts.firefox.com/legal/privacy");