Bug 1173688 - Don't show the Sync promo for https://accounts.firefox.com password doorhangers. r=markh

This commit is contained in:
Matthew Noorenberghe 2015-06-15 23:36:13 -07:00
parent 134f13802a
commit dde65d2689
4 changed files with 15 additions and 8 deletions

View File

@ -3071,6 +3071,17 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
let viewsLeft = this._viewsLeft;
if (viewsLeft) {
let notification = this._panel.firstElementChild.notification;
if (this._notificationType == "passwords" && notification && notification.options &&
notification.options.origin) {
let fxAOrigin = new URL(Services.prefs.getCharPref("identity.fxaccounts.remote.signup.uri")).origin
if (notification.options.origin == fxAOrigin) {
// Somewhat gross hack - we don't want to show the sync promo while
// the user may be logging into Sync.
return;
}
}
if (Services.prefs.prefHasUserValue("services.sync.username") &&
this._notificationType != "addons-sync-disabled") {
// If the user has already setup Sync, don't show the notification.

View File

@ -653,14 +653,6 @@ var LoginManagerContent = {
return;
}
// Somewhat gross hack - we don't want to show the "remember password"
// notification on about:accounts for Firefox.
let topWin = win.top;
if (/^about:accounts($|\?)/i.test(topWin.document.documentURI)) {
log("(form submission ignored -- about:accounts)");
return;
}
let formSubmitURL = LoginUtils._getActionOrigin(form);
let messageManager = messageManagerFromWindow(win);

View File

@ -938,6 +938,7 @@ LoginManagerPrompter.prototype = {
secondaryActions,
{
timeout: Date.now() + 10000,
origin: login.hostname,
persistWhileVisible: true,
passwordNotificationType: type,
eventCallback: function (topic) {

View File

@ -212,6 +212,9 @@ PopupNotifications.prototype = {
* @param options
* An options JavaScript object holding additional properties for the
* notification. The following properties are currently supported:
* origin: A string representing the origin of the site presenting
* a notification so it can be shown to the user (possibly
* with a favicon). e.g. https://example.com:8080
* persistence: An integer. The notification will not automatically
* dismiss for this many page loads.
* timeout: A time in milliseconds. The notification will not