Bug 716643 - Sync promotion in add-on installed doorhanger, r=mak

This commit is contained in:
Theo Chevalier 2012-09-16 00:06:34 +02:00
parent a2654ad948
commit 1e19325d7b
2 changed files with 27 additions and 2 deletions

View File

@ -1642,6 +1642,12 @@
return "passwords";
if (type == "editBookmarkPanel")
return "bookmarks";
if (type == "addon-install-complete") {
if (!Services.prefs.prefHasUserValue("services.sync.username"))
return "addons";
if (!Services.prefs.getBoolPref("services.sync.engine.addons"))
return "addons-sync-disabled";
}
return null;
]]></getter>
</property>
@ -1653,6 +1659,14 @@
);
]]></getter>
</property>
<property name="_notificationLink">
<getter><![CDATA[
if (this._notificationType == "addons-sync-disabled") {
return "https://support.mozilla.org/kb/how-do-i-enable-add-sync";
}
return "https://services.mozilla.com/sync/";
]]></getter>
</property>
<method name="onCloseButtonCommand">
<body><![CDATA[
this._viewsLeft = 0;
@ -1683,7 +1697,8 @@
let viewsLeft = this._viewsLeft;
if (viewsLeft) {
if (Services.prefs.prefHasUserValue("services.sync.username")) {
if (Services.prefs.prefHasUserValue("services.sync.username") &&
this._notificationType != "addons-sync-disabled") {
// If the user has already setup Sync, don't show the notification.
this._viewsLeft = 0;
// Be sure to hide the panel, in case it was visible and the user
@ -1696,7 +1711,7 @@
this._viewsLeft = viewsLeft - 1;
}
this._promolink.setAttribute("href", "https://services.mozilla.com/sync/");
this._promolink.setAttribute("href", this._notificationLink);
this._promolink.value = gNavigatorBundle.getString("syncPromoNotification.learnMoreLinkText");
this.hidden = false;

View File

@ -340,6 +340,16 @@ syncPromoNotification.bookmarks.description=You can access your bookmarks on all
# The final space separates this text from the Learn More link.
syncPromoNotification.passwords.description=You can access your passwords on all your devices with %S.\u0020
syncPromoNotification.learnMoreLinkText=Learn More
# LOCALIZATION NOTE (syncPromoNotification.addons.label): This appears in
# the add-on install complete panel when Sync isn't set.
# %S will be replaced by syncBrandShortName.
# The final space separates this text from the Learn More link.
syncPromoNotification.addons.description=You can access your add-ons on all your devices with %S.\u0020
# LOCALIZATION NOTE (syncPromoNotification.addons-sync-disabled.label):
# This appears in the add-on install complete panel when Sync is set
# but addons sync is not. %S will be replaced by syncBrandShortName.
# The final space separates this text from the Learn More link.
syncPromoNotification.addons-sync-disabled.description=You can use your %S account to synchronize add-ons across multiple devices.\u0020
# Telemetry prompt
# LOCALIZATION NOTE (telemetryOptInPrompt): %1$S will be replaced by