Bug 699513 - Advertise Telemetry opt-in on mobile [r=mfinkle]

--HG--
extra : rebase_source : c435ed26eb852ebb17bfe4474f39ca2d75c5f9c7
This commit is contained in:
Brian Nicholson 2011-11-11 12:31:16 -08:00
parent b3c29f4e3a
commit f395e85f03
2 changed files with 35 additions and 0 deletions

View File

@ -204,6 +204,36 @@ var BrowserApp = {
type: "Gecko:Ready"
}
});
let telemetryPrompted = false;
try {
telemetryPrompted = Services.prefs.getBoolPref("toolkit.telemetry.prompted");
} catch (e) {
// optional
}
if (!telemetryPrompted) {
let buttons = [
{
label: Strings.browser.GetStringFromName("telemetry.optin.yes"),
callback: function () {
Services.prefs.setBoolPref("toolkit.telemetry.prompted", true);
Services.prefs.setBoolPref("toolkit.telemetry.enabled", true);
}
},
{
label: Strings.browser.GetStringFromName("telemetry.optin.no"),
callback: function () {
Services.prefs.setBoolPref("toolkit.telemetry.prompted", true);
Services.prefs.setBoolPref("toolkit.telemetry.enabled", false);
}
}
];
let brandShortName = Strings.brand.GetStringFromName("brandShortName");
let message = Strings.browser.formatStringFromName("telemetry.optin.message", [brandShortName], 1);
NativeWindow.doorhanger.show(message, "telemetry-optin", buttons);
}
},
shutdown: function shutdown() {

View File

@ -127,6 +127,11 @@ popupButtonAllowOnce=Show
popupButtonAlwaysAllow2=Always Show
popupButtonNeverWarn2=Never Show
# Telemetry
telemetry.optin.message=Help improve %S by sending anonymous usage information to Mozilla?
telemetry.optin.yes=Yes
telemetry.optin.no=No
# XPInstall
xpinstallPromptWarning2=%S prevented this site (%S) from asking you to install software on your device.
xpinstallPromptAllowButton=Allow