back out 865bd171fc46 (bug 652657) since review comments weren't addressed

This commit is contained in:
Gavin Sharp 2011-06-23 18:31:49 -04:00
parent d6fdcfa8c3
commit 2bdc02ff5b
6 changed files with 2 additions and 90 deletions

View File

@ -389,9 +389,6 @@ BrowserGlue.prototype = {
this._showPlacesLockedNotificationBox();
}
// Show telemetry notification, if needed.
this._showTelemetryNotification();
// If there are plugins installed that are outdated, and the user hasn't
// been warned about them yet, open the plugins update page.
if (Services.prefs.getBoolPref(PREF_PLUGINS_NOTIFYUSER))
@ -738,66 +735,6 @@ BrowserGlue.prototype = {
}
},
_showTelemetryNotification: function BG__showTelemetryNotification() {
const PREF_TELEMETRY_PROMPTED = "toolkit.telemetry.prompted";
const PREF_TELEMETRY_ENABLED = "toolkit.telemetry.enabled";
const PREF_TELEMETRY_INFOURL = "toolkit.telemetry.infoURL";
const PREF_TELEMETRY_SERVER_OWNER = "toolkit.telemetry.server_owner";
try {
// If the user hasn't already been prompted, ask if they want to
// send telemetry data.
if (Services.prefs.getBoolPref(PREF_TELEMETRY_PROMPTED) ||
Services.prefs.getBoolPref(PREF_TELEMETRY_ENABLED))
return;
} catch(e) {}
// Stick the notification onto the selected tab of the active browser window.
var win = this.getMostRecentBrowserWindow();
var browser = win.gBrowser; // for closure in notification bar callback
var notifyBox = browser.getNotificationBox();
var browserBundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");
var brandBundle = Services.strings.createBundle("chrome://branding/locale/brand.properties");
var productName = brandBundle.GetStringFromName("brandFullName");
var serverOwner = Services.prefs.getCharPref(PREF_TELEMETRY_SERVER_OWNER);
var telemetryText = browserBundle.formatStringFromName("telemetryText", [productName, serverOwner], 2);
var buttons = [
{
label: browserBundle.GetStringFromName("telemetryButtonLabel"),
accessKey: browserBundle.GetStringFromName("telemetryButtonAccessKey"),
popup: null,
callback: function(aNotificationBar, aButton) {
Services.prefs.setBoolPref(PREF_TELEMETRY_ENABLED, true);
}
}
];
// Set pref to indicate we've shown the notification.
Services.prefs.setBoolPref(PREF_TELEMETRY_PROMPTED, true);
var notification = notifyBox.appendNotification(telemetryText, "telemetry", null, notifyBox.PRIORITY_INFO_LOW, buttons);
notification.persistence = 3; // arbitrary number, just so bar sticks around for a bit
let XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
let link = notification.ownerDocument.createElementNS(XULNS, "label");
link.className = "text-link telemetry-text-link";
link.setAttribute("value", browserBundle.GetStringFromName("telemetryLinkLabel"));
link.addEventListener('click', function() {
// Open the learn more url in a new tab
browser.selectedTab = browser.addTab(Services.prefs.getCharPref(PREF_TELEMETRY_INFOURL));
// Remove the notification on which the user clicked
notification.parentNode.removeCurrentNotification(true);
// Add a new notification to that tab, with no "Learn more" link
var notifyBox = browser.getNotificationBox();
notifyBox.appendNotification(telemetryText, "telemetry", null, notifyBox.PRIORITY_INFO_LOW, buttons);
}, false);
let description = notification.ownerDocument.getAnonymousElementByAttribute(notification, "anonid", "messageText");
description.appendChild(link);
},
_showPluginUpdatePage: function BG__showPluginUpdatePage() {
Services.prefs.setBoolPref(PREF_PLUGINS_NOTIFYUSER, false);

View File

@ -82,10 +82,6 @@
type="bool"/>
#endif
<preference id="toolkit.telemetry.enabled"
name="toolkit.telemetry.enabled"
type="bool"/>
<!-- Network tab -->
<preference id="browser.cache.disk.capacity" name="browser.cache.disk.capacity" type="int"/>
<preference id="browser.offline-apps.notify" name="browser.offline-apps.notify" type="bool"/>
@ -197,11 +193,11 @@
preference="layout.spellcheckDefault"/>
</groupbox>
#ifdef HAVE_SHELL_SERVICE
<!-- System Defaults -->
<groupbox id="systemDefaultsGroup" orient="vertical">
<caption label="&systemDefaults.label;"/>
#ifdef HAVE_SHELL_SERVICE
<hbox id="checkDefaultBox" align="center" flex="1">
<checkbox id="alwaysCheckDefault" preference="browser.shell.checkDefaultBrowser"
label="&alwaysCheckDefault.label;" accesskey="&alwaysCheckDefault.accesskey;"
@ -216,11 +212,8 @@
oncommand="gAdvancedPane.updateSubmitCrashes();"
label="&submitCrashes.label;" accesskey="&submitCrashes.accesskey;"/>
#endif
#endif
<checkbox id="submitTelemetryBox" flex="1"
preference="toolkit.telemetry.enabled"
label="&submitTelemetry.label;" accesskey="&submitTelemetry.accesskey;"/>
</groupbox>
#endif
</tabpanel>
<!-- Network -->

View File

@ -323,11 +323,3 @@ syncPromoNotification.bookmarks.label=You can access your bookmarks on all your
# the remember password panel. %S will be replaced by syncBrandShortName.
syncPromoNotification.passwords.label=You can access your passwords on all your devices with %S.
syncPromoNotification.learnMoreLinkText=Learn More
# Telemetry prompt
# LOCALIZATION NOTE (telemetryText): %1$S will be replaced by brandFullName,
# and %2$S by the value of the toolkit.telemetry.server_owner preference.
telemetryText = Would you like to help improve %1$S by automatically reporting memory usage, performance, and responsiveness to %2$S?
telemetryLinkLabel = Learn More
telemetryButtonLabel = Yes
telemetryButtonAccessKey = Y

View File

@ -29,8 +29,6 @@
<!ENTITY checkNow.accesskey "N">
<!ENTITY submitCrashes.label "Submit crash reports">
<!ENTITY submitCrashes.accesskey "S">
<!ENTITY submitTelemetry.label "Submit performance data">
<!ENTITY submitTelemetry.accesskey "P">
<!ENTITY networkTab.label "Network">

View File

@ -2167,10 +2167,6 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker {
-moz-margin-start: 0; /* override default label margin to match description margin */
}
.telemetry-text-link {
color: #fff;
}
#addons-notification-icon {
list-style-image: url(chrome://mozapps/skin/extensions/extensionGeneric-16.png);
}

View File

@ -276,10 +276,6 @@ pref("toolkit.scrollbox.clickToScroll.scrollDelay", 150);
// Telemetry
pref("toolkit.telemetry.enabled", false);
pref("toolkit.telemetry.server", "https://data.mozilla.com");
// Telemetry server owner. Please change if you set toolkit.telemetry.server to a different server
pref("toolkit.telemetry.server_owner", "Mozilla");
// Information page about telemetry (temporary ; will be about:telemetry in the end)
pref("toolkit.telemetry.infoURL", "http://www.mozilla.com/legal/privacy/firefox.html#telemetry");
// view source
pref("view_source.syntax_highlight", true);