Bug 1562006 - Update FxA toolbar menu for skyline r=eoger,Gijs,fluent-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D37961
This commit is contained in:
@@ -489,6 +489,26 @@ XPCOMUtils.defineLazyPreferenceGetter(
|
||||
}
|
||||
);
|
||||
|
||||
XPCOMUtils.defineLazyPreferenceGetter(
|
||||
this,
|
||||
"gFxaSendLoginUrl",
|
||||
"identity.fxaccounts.service.sendLoginUrl",
|
||||
false,
|
||||
(aPref, aOldVal, aNewVal) => {
|
||||
showFxaToolbarMenu(gFxaToolbarEnabled);
|
||||
}
|
||||
);
|
||||
|
||||
XPCOMUtils.defineLazyPreferenceGetter(
|
||||
this,
|
||||
"gFxaMonitorLoginUrl",
|
||||
"identity.fxaccounts.service.monitorLoginUrl",
|
||||
false,
|
||||
(aPref, aOldVal, aNewVal) => {
|
||||
showFxaToolbarMenu(gFxaToolbarEnabled);
|
||||
}
|
||||
);
|
||||
|
||||
XPCOMUtils.defineLazyPreferenceGetter(
|
||||
this,
|
||||
"gMsgingSystemFxABadge",
|
||||
@@ -648,6 +668,18 @@ function showFxaToolbarMenu(enable) {
|
||||
} else {
|
||||
mainWindowEl.removeAttribute("fxa_avatar_badged");
|
||||
}
|
||||
|
||||
// When the pref for a FxA service is removed, we remove it from
|
||||
// the FxA toolbar menu as well. This is useful when the service
|
||||
// might not be available that browser.
|
||||
document.getElementById(
|
||||
"PanelUI-fxa-menu-send-button"
|
||||
).hidden = !gFxaSendLoginUrl;
|
||||
document.getElementById(
|
||||
"PanelUI-fxa-menu-monitor-button"
|
||||
).hidden = !gFxaMonitorLoginUrl;
|
||||
document.getElementById("fxa-menu-service-separator").hidden =
|
||||
!gFxaSendLoginUrl && !gFxaMonitorLoginUrl;
|
||||
} else {
|
||||
mainWindowEl.removeAttribute("fxatoolbarmenu");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user