back out 865bd171fc46 (bug 652657) since review comments weren't addressed
authorGavin Sharp <gavin@gavinsharp.com>
Thu, 23 Jun 2011 18:31:49 -0400
changeset 71914 6be508728e3b6c44d86c5afa93cfb03337ebae63
parent 71913 2c55cb8097d200b7cb6bab617e35056ccf7233b2
child 71915 9de9b3a9458ceb0004459e228e8d9d9f436acb0b
push id209
push userbzbarsky@mozilla.com
push dateTue, 05 Jul 2011 17:42:16 +0000
treeherdermozilla-aurora@cc6e30cce8af [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs652657
milestone7.0a1
backs out865bd171fc46ad42307a73e504ed7f80ea0ce0ca
back out 865bd171fc46 (bug 652657) since review comments weren't addressed
browser/components/nsBrowserGlue.js
browser/components/preferences/advanced.xul
browser/locales/en-US/chrome/browser/browser.properties
browser/locales/en-US/chrome/browser/preferences/advanced.dtd
browser/themes/pinstripe/browser/browser.css
modules/libpref/src/init/all.js
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -384,19 +384,16 @@ BrowserGlue.prototype = {
       this._showUpdateNotification();
 
     // Load the "more info" page for a locked places.sqlite
     // This property is set earlier by places-database-locked topic.
     if (this._isPlacesDatabaseLocked) {
       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))
       this._showPluginUpdatePage();
   },
 
   _onQuitRequest: function BG__onQuitRequest(aCancelQuit, aQuitType) {
     // If user has already dismissed quit request, then do nothing
@@ -733,76 +730,16 @@ BrowserGlue.prototype = {
       // be displayed per the idl.
       notifier.showAlertNotification("post-update-notification", title, text,
                                      true, url, clickCallback);
     }
     catch (e) {
     }
   },
 
-  _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);
 
     var formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].
                     getService(Ci.nsIURLFormatter);
     var updateUrl = formatter.formatURLPref(PREF_PLUGINS_UPDATEURL);
 
     var win = this.getMostRecentBrowserWindow();
--- a/browser/components/preferences/advanced.xul
+++ b/browser/components/preferences/advanced.xul
@@ -77,20 +77,16 @@
                   name="browser.shell.checkDefaultBrowser"
                   type="bool"/>
 
       <preference id="pref.general.disable_button.default_browser"
                   name="pref.general.disable_button.default_browser"
                   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"/>
  
       <preference id="browser.cache.disk.smart_size.enabled"
                   name="browser.cache.disk.smart_size.enabled"
                   inverted="true"
                   type="bool"/>
@@ -192,40 +188,37 @@
             <checkbox id="checkSpelling"
                       label="&checkSpelling.label;"
                       accesskey="&checkSpelling.accesskey;"
                       onsyncfrompreference="return gAdvancedPane.readCheckSpelling();"
                       onsynctopreference="return gAdvancedPane.writeCheckSpelling();"
                       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;"
                         flex="1"/>
               <button id="checkDefaultButton"
                       label="&checkNow.label;" accesskey="&checkNow.accesskey;"
                       oncommand="gAdvancedPane.checkNow()"
                       preference="pref.general.disable_button.default_browser"/>
             </hbox>
 #ifdef MOZ_CRASHREPORTER
             <checkbox id="submitCrashesBox" flex="1"
                       oncommand="gAdvancedPane.updateSubmitCrashes();"
                       label="&submitCrashes.label;" accesskey="&submitCrashes.accesskey;"/>
 #endif
+          </groupbox>
 #endif
-            <checkbox id="submitTelemetryBox" flex="1"
-                      preference="toolkit.telemetry.enabled"
-                      label="&submitTelemetry.label;" accesskey="&submitTelemetry.accesskey;"/>
-          </groupbox>
         </tabpanel>
 
         <!-- Network -->
         <tabpanel id="networkPanel" orient="vertical">
 
           <!-- Connection -->
           <groupbox id="connectionGroup">
             <caption label="&connection.label;"/>
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -318,16 +318,8 @@ browser.menu.showCharacterEncoding=false
 
 # LOCALIZATION NOTE (syncPromoNotification.bookmarks.label): This appears in
 # the add bookmark star panel.  %S will be replaced by syncBrandShortName.
 syncPromoNotification.bookmarks.label=You can access your bookmarks on all your devices with %S.
 # LOCALIZATION NOTE (syncPromoNotification.passwords.label): This appears in
 # 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
--- a/browser/locales/en-US/chrome/browser/preferences/advanced.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/advanced.dtd
@@ -24,18 +24,16 @@
 
 <!ENTITY systemDefaults.label            "System Defaults">
 <!ENTITY alwaysCheckDefault.label        "Always check to see if &brandShortName; is the default browser on startup"><!--XXX-->
 <!ENTITY alwaysCheckDefault.accesskey    "w">
 <!ENTITY checkNow.label                  "Check Now">
 <!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">
 
 <!ENTITY connection.label                "Connection">
 
 <!ENTITY connectionDesc.label            "Configure how &brandShortName; connects to the Internet">
 <!ENTITY connectionSettings.label        "Settingsā€¦">
 <!ENTITY connectionSettings.accesskey    "e">
--- a/browser/themes/pinstripe/browser/browser.css
+++ b/browser/themes/pinstripe/browser/browser.css
@@ -2162,20 +2162,16 @@ toolbarbutton.chevron > .toolbarbutton-m
   list-style-image: url(chrome://browser/skin/Geolocation-16.png);
 }
 
 .geolocation-text-link {
   color: #fff;
   -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);
 }
 
 #password-notification-icon {
   list-style-image: url(chrome://mozapps/skin/passwordmgr/key-16.png);
 }
 
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -271,20 +271,16 @@ pref("toolkit.autocomplete.richBoundaryC
 
 pref("toolkit.scrollbox.smoothScroll", true);
 pref("toolkit.scrollbox.scrollIncrement", 20);
 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);
 pref("view_source.wrap_long_lines", false);
 pref("view_source.editor.external", false);
 pref("view_source.editor.path", "");
 // allows to add further arguments to the editor; use the %LINE% placeholder
 // for jumping to a specific line (e.g. "/line:%LINE%" or "--goto %LINE%")