зеркало из https://github.com/mozilla/gecko-dev.git
Bug 962709 - Fix about:home's sync entry point to work with about FxAccounts r=markh
This commit is contained in:
Родитель
d51cde8d35
Коммит
dfda4fc2cc
|
@ -15,6 +15,8 @@ Components.utils.import("resource://gre/modules/Services.jsm");
|
|||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
|
||||
"resource://gre/modules/PrivateBrowsingUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "fxAccounts",
|
||||
"resource://gre/modules/FxAccounts.jsm");
|
||||
|
||||
// Url to fetch snippets, in the urlFormatter service format.
|
||||
const SNIPPETS_URL_PREF = "browser.aboutHomeSnippets.updateUrl";
|
||||
|
@ -146,7 +148,21 @@ let AboutHome = {
|
|||
break;
|
||||
|
||||
case "AboutHome:Sync":
|
||||
window.openPreferences("paneSync");
|
||||
let weave = Cc["@mozilla.org/weave/service;1"]
|
||||
.getService(Ci.nsISupports)
|
||||
.wrappedJSObject;
|
||||
|
||||
if (weave.fxAccountsEnabled) {
|
||||
fxAccounts.getSignedInUser().then(userData => {
|
||||
if (userData) {
|
||||
window.openPreferences("paneSync");
|
||||
} else {
|
||||
window.loadURI("about:accounts");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
window.openPreferences("paneSync");
|
||||
}
|
||||
break;
|
||||
|
||||
case "AboutHome:Settings":
|
||||
|
|
Загрузка…
Ссылка в новой задаче