Bug 667577 - Don't show the telemetry prompt unless the MOZ_TELEMETRY_REPORTING variable is defined. r=khuey,a=asa
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 15 Jul 2011 18:57:13 +0200
changeset 72705 08ce839b81cc09fe33fcc7a49287eceb65442b58
parent 72704 7a76cd285475ce6f991c6d19dba2369e3f171336
child 72706 06fee5653ceb39c29cea6d41e4f23c311a97eb9f
push id250
push usermh@glandium.org
push dateFri, 22 Jul 2011 06:35:31 +0000
treeherdermozilla-aurora@08ce839b81cc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey, asa
bugs667577
milestone7.0a2
Bug 667577 - Don't show the telemetry prompt unless the MOZ_TELEMETRY_REPORTING variable is defined. r=khuey,a=asa
browser/components/nsBrowserGlue.js
configure.in
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -373,19 +373,21 @@ BrowserGlue.prototype = {
     this._sanitizer.onShutdown();
   },
 
   // Browser startup complete. All initial windows have opened.
   _onBrowserStartup: function BG__onBrowserStartup() {
     // Show about:rights notification, if needed.
     if (this._shouldShowRights()) {
       this._showRightsNotification();
+#ifdef MOZ_TELEMETRY_REPORTING
     } else {
       // Only show telemetry notification when about:rights notification is not shown.
       this._showTelemetryNotification();
+#endif
     }
 
 
     // Show update notification, if needed.
     if (Services.prefs.prefHasUserValue("app.update.postupdate"))
       this._showUpdateNotification();
 
     // Load the "more info" page for a locked places.sqlite
@@ -735,16 +737,17 @@ BrowserGlue.prototype = {
       // be displayed per the idl.
       notifier.showAlertNotification("post-update-notification", title, text,
                                      true, url, clickCallback);
     }
     catch (e) {
     }
   },
 
+#ifdef MOZ_TELEMETRY_REPORTING
   _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
@@ -800,16 +803,17 @@ BrowserGlue.prototype = {
       notification.parentNode.removeNotification(notification, 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);
   },
+#endif
 
   _showPluginUpdatePage: function BG__showPluginUpdatePage() {
     Services.prefs.setBoolPref(PREF_PLUGINS_NOTIFYUSER, false);
 
     var formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].
                     getService(Ci.nsIURLFormatter);
     var updateUrl = formatter.formatURLPref(PREF_PLUGINS_UPDATEURL);
 
--- a/configure.in
+++ b/configure.in
@@ -8960,16 +8960,20 @@ AC_DEFINE_UNQUOTED(FIREFOX_VERSION,$FIRE
 AC_SUBST(FIREFOX_VERSION)
 AC_DEFINE_UNQUOTED(MOZ_UA_BUILDID, "$MOZ_UA_BUILDID")
 AC_SUBST(MOZ_UA_BUILDID)
 
 AC_SUBST(MOZ_PKG_SPECIAL)
 
 AC_SUBST(MOZILLA_OFFICIAL)
 
+if test "$MOZ_TELEMETRY_REPORTING"; then
+    AC_DEFINE(MOZ_TELEMETRY_REPORTING)
+fi
+
 dnl win32 options
 AC_SUBST(MOZ_MAPINFO)
 AC_SUBST(MOZ_BROWSE_INFO)
 AC_SUBST(MOZ_TOOLS_DIR)
 AC_SUBST(WIN32_REDIST_DIR)
 AC_SUBST(PYTHON)
 AC_SUBST(MAKENSISU)