Bug 466086 - Remove unused safebrowsing phishing EULA. r=gavin
authorJustin Dolske <dolske@mozilla.com>
Thu, 16 Apr 2009 18:27:23 -0700
changeset 27414 d6d899039252f6524c871e273502bab2ecc042f7
parent 27413 68fa45d1a03955ee08374779351a8670fc0c716c
child 27415 0ff7df5ccda23457dfe2896412692bd425d94fa8
push id6546
push userjdolske@mozilla.com
push dateFri, 17 Apr 2009 01:27:57 +0000
treeherdermozilla-central@d6d899039252 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs466086
milestone1.9.2a1pre
Bug 466086 - Remove unused safebrowsing phishing EULA. r=gavin
browser/app/profile/firefox.js
browser/components/preferences/fallbackEULA.xhtml
browser/components/preferences/jar.mn
browser/components/preferences/phishEULA.js
browser/components/preferences/phishEULA.xhtml
browser/components/preferences/phishEULA.xul
browser/locales/en-US/chrome/browser/preferences/fallbackEULA.dtd
browser/locales/en-US/chrome/browser/preferences/phishEULA.dtd
browser/locales/jar.mn
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -660,21 +660,16 @@ pref("browser.safebrowsing.dataProvider"
 
 // Does the provider name need to be localizable?
 pref("browser.safebrowsing.provider.0.name", "Google");
 pref("browser.safebrowsing.provider.0.lookupURL", "http://safebrowsing.clients.google.com/safebrowsing/lookup?sourceid=firefox-antiphish&features=TrustRank&client={moz:client}&appver={moz:version}&");
 pref("browser.safebrowsing.provider.0.keyURL", "https://sb-ssl.google.com/safebrowsing/newkey?client={moz:client}&appver={moz:version}&pver=2.2");
 pref("browser.safebrowsing.provider.0.reportURL", "http://safebrowsing.clients.google.com/safebrowsing/report?");
 pref("browser.safebrowsing.provider.0.gethashURL", "http://safebrowsing.clients.google.com/safebrowsing/gethash?client={moz:client}&appver={moz:version}&pver=2.2");
 
-// privacy policy -- Both url and fallbackurl must exist, although they may
-// point to the same file.  fallbackurl must be a chrome url
-pref("browser.safebrowsing.provider.0.privacy.url", "http://www.google.com/tools/firefox/firefox_privacy.html?hl=%LOCALE%");
-pref("browser.safebrowsing.provider.0.privacy.fallbackurl", "chrome://browser/content/preferences/phishEULA.xhtml");
-
 // HTML report pages
 pref("browser.safebrowsing.provider.0.reportGenericURL", "http://{moz:locale}.phish-generic.mozilla.com/?hl={moz:locale}");
 pref("browser.safebrowsing.provider.0.reportErrorURL", "http://{moz:locale}.phish-error.mozilla.com/?hl={moz:locale}");
 pref("browser.safebrowsing.provider.0.reportPhishURL", "http://{moz:locale}.phish-report.mozilla.com/?hl={moz:locale}");
 pref("browser.safebrowsing.provider.0.reportMalwareURL", "http://{moz:locale}.malware-report.mozilla.com/?hl={moz:locale}");
 pref("browser.safebrowsing.provider.0.reportMalwareErrorURL", "http://{moz:locale}.malware-error.mozilla.com/?hl={moz:locale}");
 
 // FAQ URLs
deleted file mode 100644
--- a/browser/components/preferences/fallbackEULA.xhtml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE html [
-  <!ENTITY % htmlDTD
-    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "DTD/xhtml1-strict.dtd">
-  %htmlDTD;
-  <!ENTITY % phisheulaDTD
-    SYSTEM "chrome://browser/locale/preferences/fallbackEULA.dtd">
-  %phisheulaDTD;
-]>
-
-<html id="fallback-eula"
-      xmlns="http://www.w3.org/1999/xhtml">
-  <body>&fallback.text;</body>
-</html>
--- a/browser/components/preferences/jar.mn
+++ b/browser/components/preferences/jar.mn
@@ -8,31 +8,27 @@ browser.jar:
 *   content/browser/preferences/applicationManager.js
 *   content/browser/preferences/colors.xul
 *   content/browser/preferences/cookies.xul
 *   content/browser/preferences/cookies.js
 *   content/browser/preferences/content.xul
 *   content/browser/preferences/content.js
 *   content/browser/preferences/connection.xul
 *   content/browser/preferences/connection.js
-*   content/browser/preferences/fallbackEULA.xhtml
 *   content/browser/preferences/fonts.xul
 *   content/browser/preferences/fonts.js
 *   content/browser/preferences/handlers.xml
 *   content/browser/preferences/handlers.css
 *   content/browser/preferences/languages.xul
 *   content/browser/preferences/languages.js
 *   content/browser/preferences/main.xul
 *   content/browser/preferences/main.js
 *   content/browser/preferences/permissions.xul
 *   content/browser/preferences/permissions.js
 *   content/browser/preferences/permissionsutils.js
-*   content/browser/preferences/phishEULA.xul
-*   content/browser/preferences/phishEULA.js
-*   content/browser/preferences/phishEULA.xhtml
 *   content/browser/preferences/preferences.xul
 *   content/browser/preferences/privacy.xul
 *   content/browser/preferences/privacy.js
 *   content/browser/preferences/sanitize.xul
 *   content/browser/preferences/security.xul
 *   content/browser/preferences/security.js
 *   content/browser/preferences/securityWarnings.xul
 *   content/browser/preferences/securityWarnings.js
deleted file mode 100644
--- a/browser/components/preferences/phishEULA.js
+++ /dev/null
@@ -1,226 +0,0 @@
-# -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is Firefox Anti-Phishing Support.
-#
-# The Initial Developer of the Original Code is
-# Mozilla Corporation.
-# Portions created by the Initial Developer are Copyright (C) 2006
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#   Jeff Walden <jwalden+code@mit.edu>   (original author)
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-/**
- * gPhishDialog controls the user interface for displaying the privacy policy of
- * an anti-phishing provider. 
- * 
- * The caller (gSecurityPane._userAgreedToPhishingEULA in main.js) invokes this
- * dialog with a single argument - a reference to an object with .providerNum
- * and .userAgreed properties.  This code displays the dialog for the provider
- * as dictated by .providerNum and loads the policy.  When that load finishes,
- * the OK button is enabled and the user can either accept or decline the
- * agreement (a choice which is communicated by setting .userAgreed to true if
- * the user did indeed agree).
- */ 
-var gPhishDialog = {
-  /**
-   * The nsIWebProgress object associated with the privacy policy frame.
-   */
-  _webProgress: null,
-
-  /**
-   * Initializes UI and starts the privacy policy loading.
-   */
-  init: function ()
-  {
-    const Cc = Components.classes, Ci = Components.interfaces;
-
-    var providerNum = window.arguments[0].providerNum;
-
-    var phishBefore = document.getElementById("phishBefore");
-
-    var prefb = Cc["@mozilla.org/preferences-service;1"].
-                getService(Ci.nsIPrefService).
-                getBranch("browser.safebrowsing.provider.");
-
-    // init before-frame and after-frame strings
-    // note that description only wraps when the string is the element's
-    // *content* and *not* when it's the value attribute
-    var providerName = prefb.getComplexValue(providerNum + ".name", Ci.nsISupportsString).data
-    var strings = document.getElementById("bundle_phish");
-    phishBefore.textContent = strings.getFormattedString("phishBeforeText", [providerName]);
-
-    // guaranteed to be present, because only providers with privacy policies
-    // are displayed in the prefwindow
-    var formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].
-                    getService(Ci.nsIURLFormatter);
-    var privacyURL = formatter.formatURLPref("browser.safebrowsing.provider." +
-                                             providerNum +
-                                             ".privacy.url",
-                                             null);
-    var fallbackURL = formatter.formatURLPref("browser.safebrowsing.provider." +
-                                              providerNum +
-                                              ".privacy.fallbackurl",
-                                              null);
-    this._progressListener._providerFallbackURL = fallbackURL;
-
-    // add progress listener to enable OK, radios when page loads
-    var frame = document.getElementById("phishPolicyFrame");
-    var docShell = frame.docShell;
-
-    // disable unnecessary features
-    docShell.allowAuth = false;
-    docShell.allowPlugins = false;
-    docShell.allowSubframes = false;
-
-    var webProgress = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
-                              .getInterface(Ci.nsIWebProgress);
-    webProgress.addProgressListener(this._progressListener,
-                                    Ci.nsIWebProgress.NOTIFY_STATE_WINDOW);
-
-    this._webProgress = webProgress; // for easy use later
-
-    // start loading the privacyURL
-    const loadFlags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE;
-    frame.webNavigation.loadURI(privacyURL, loadFlags, null, null, null);
-  },
-
-  /**
-   * The nsIWebProgressListener used to watch the status of the load of the
-   * privacy policy; enables the OK button when the load completes.
-   */
-  _progressListener:
-  {
-    /**
-     * First we try to load the provider url (possibly remote). If that fails
-     * to load, we try to load the provider fallback url (must be chrome://).
-     * If that also fails, we display an error message.
-     */
-    _providerLoadFailed: false,
-    _providerFallbackLoadFailed: false,
-    
-    _tryLoad: function(url) {
-      const Ci = Components.interfaces;
-      const loadFlags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE;
-      var frame = document.getElementById("phishPolicyFrame");
-      frame.webNavigation.loadURI(url, loadFlags, null, null, null);
-    },
-
-    onStateChange: function (aWebProgress, aRequest, aStateFlags, aStatus)
-    {
-      // enable the OK button when the request completes
-      const Ci = Components.interfaces, Cr = Components.results;
-      if ((aStateFlags & Ci.nsIWebProgressListener.STATE_STOP) &&
-          (aStateFlags & Ci.nsIWebProgressListener.STATE_IS_WINDOW)) {
-        
-        if (Components.isSuccessCode(aRequest.status)) {
-          try {
-            aRequest.QueryInterface(Ci.nsIHttpChannel);
-          } catch (e) {
-            // Not an http request url (might be, e.g., chrome:) that loaded
-            // successfully, so we can exit.
-            return;
-          }
-
-          // Any response other than 200 OK is an error.
-          if (200 == aRequest.responseStatus)
-            return;
-        }
-
-        // Something failed
-        if (!this._providerLoadFailed) {
-          this._provderLoadFailed = true;
-          // Remote EULA failed to load; try loading provider fallback
-          this._tryLoad(this._providerFallbackURL);
-        } else if (!this._providerFallbackLoadFailed) {
-          // Provider fallback failed to load; try loading fallback EULA
-          this._providerFallbackLoadFailed = true;
-
-          // fire off a load of the fallback policy
-          const fallbackURL = "chrome://browser/content/preferences/fallbackEULA.xhtml";
-          this._tryLoad(fallbackURL);
-
-          // disable radios
-          document.getElementById("acceptOrDecline").disabled = true;
-        } else {
-          throw "Fallback policy failed to load -- what the hay!?!";
-        }
-      }
-    },
-    
-    onProgressChange: function(aWebProgress, aRequest, aCurSelfProgress,
-                               aMaxSelfProgress, aCurTotalProgress,
-                               aMaxTotalProgress)
-    {
-    },
-
-    onStatusChange : function(aWebProgress, aRequest, aStatus, aMessage)
-    {
-    },
-
-    QueryInterface : function(aIID)
-    {
-      const Ci = Components.interfaces;
-      if (aIID.equals(Ci.nsIWebProgressListener) ||
-          aIID.equals(Ci.nsISupportsWeakReference) ||
-          aIID.equals(Ci.nsISupports))
-        return this;
-      throw Components.results.NS_NOINTERFACE;
-    }
-  },
-
-  /**
-   * Signals that the user accepted the privacy policy by setting the window
-   * arguments appropriately.  Note that this does *not* change preferences;
-   * the opener of this dialog handles that.
-   */
-  accept: function ()
-  {
-    window.arguments[0].userAgreed = true;
-  },
-
-  /**
-   * Clean up any XPCOM-JS cycles we may have created.
-   */
-  uninit: function ()
-  {
-    // overly aggressive, but better safe than sorry
-    this._webProgress.removeProgressListener(this._progressListener);
-    this._progressListener = this._webProgress = null;
-  },
-
-  /**
-   * Called when the user changes the agree/disagree radio.
-   */
-  onchangeRadio: function ()
-  {
-    var radio = document.getElementById("acceptOrDecline");
-    document.documentElement.getButton("accept").disabled = (radio.value == "false");
-  }
-};
deleted file mode 100644
--- a/browser/components/preferences/phishEULA.xhtml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!DOCTYPE html [
-  <!ENTITY % htmlDTD
-    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "DTD/xhtml1-strict.dtd">
-  %htmlDTD;
-]>
-
-<html id="phish-eula"
-      xmlns="http://www.w3.org/1999/xhtml">
-  <body><p>
-If you choose to check with Google about each site you visit,
-Google will receive the URLs of pages you visit for evaluation.  When you
-click to accept, reject, or close the warning message that Phishing
-Protection gives you about a suspicious page, Google will log your action
-and the URL of the page.  Google will receive standard
-<a href='http://www.google.com/privacy_faq.html#serverlogs'
-   onclick='window.open(this.href);return false;'>log information</a>,
-including a cookie, as part of this process.  Google will not associate the
-information that Phishing Protection logs with other personal information
-about you. However, it is possible that a
-<a href='http://www.google.com/privacy_faq.html#urls'
-   onclick='window.open(this.href);return false;'>URL</a> sent to Google may
-itself contain personal information.  Please see the
-<a href='http://www.google.com/privacypolicy.html'
-   onclick='window.open(this.href);return false;'>Google Privacy Policy</a>
-for more information.
-  </p></body>
-</html>
deleted file mode 100644
--- a/browser/components/preferences/phishEULA.xul
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version="1.0"?>
-
-# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is the Firefox Preferences System.
-#
-# The Initial Developer of the Original Code is
-# Mozilla Corporation.
-# Portions created by the Initial Developer are Copyright (C) 2006
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#   Jeff Walden <jwalden+bmo@mit.edu>       (original author)
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-<?xml-stylesheet href="chrome://global/skin/"?>
-
-<!DOCTYPE dialog SYSTEM "chrome://browser/locale/preferences/phishEULA.dtd">
-
-<dialog id="phishDialog"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        title="&phishDlg.title;"
-        style="width: &phishDlg.width;; height: &phishDlg.height;;"
-        persist="screenX screenY width height"
-        onload="gPhishDialog.init();"
-        onunload="gPhishDialog.uninit();"
-        ondialogaccept="gPhishDialog.accept();"
-        buttonlabelaccept="&accept.label;"
-        buttonlabelcancel="&cancel.label;"
-        buttondisabledaccept="true">
-
-  <stringbundle id="bundle_phish"
-                src="chrome://browser/locale/preferences/preferences.properties"/>
-  <script type="application/javascript"
-          src="chrome://browser/content/preferences/phishEULA.js"/>
-
-  <description id="phishBefore"/>
-
-  <separator class="thin"/>
-
-  <vbox id="phishPolicy" flex="1">
-    <iframe id="phishPolicyFrame" type="content" flex="1" src=""/>
-  </vbox>
-
-  <separator class="thin"/>
-
-  <radiogroup id="acceptOrDecline"
-              oncommand="gPhishDialog.onchangeRadio();">
-    <radio value="true" label="&acceptToS.label;"/>
-    <radio value="false" selected="true" label="&declineToS.label;"/>
-  </radiogroup>
-
-  <separator class="thin"/>
-
-</dialog>
deleted file mode 100644
--- a/browser/locales/en-US/chrome/browser/preferences/fallbackEULA.dtd
+++ /dev/null
@@ -1,1 +0,0 @@
-<!ENTITY fallback.text "<p>The privacy agreement failed to load.</p>">
deleted file mode 100644
--- a/browser/locales/en-US/chrome/browser/preferences/phishEULA.dtd
+++ /dev/null
@@ -1,17 +0,0 @@
-<!ENTITY phishDlg.title  "Phishing Protection Terms of Service">
-
-<!-- LOCALIZATION NOTE:
-     The following entities contain sizing information for the phishing privacy
-     agreement dialog, which is opened when you select the "Check by asking"
-     option as how the browser checks for phishing attempts (if you haven't
-     already agreed with the policy for that provider; once you agree to a
-     provider's policy, you don't see it again).
--->
-<!ENTITY phishDlg.height      "40em">
-<!ENTITY phishDlg.width       "35em">
-
-<!ENTITY acceptToS.label      "I accept these Phishing Protection terms of service">
-<!ENTITY declineToS.label     "I do NOT accept these Phishing Protection terms of service">
-
-<!ENTITY accept.label         "Accept and Continue">
-<!ENTITY cancel.label         "Cancel">
--- a/browser/locales/jar.mn
+++ b/browser/locales/jar.mn
@@ -50,22 +50,20 @@
 *   locale/browser/preferences/advanced-scripts.dtd   (%chrome/browser/preferences/advanced-scripts.dtd)
     locale/browser/preferences/applicationManager.dtd        (%chrome/browser/preferences/applicationManager.dtd)
     locale/browser/preferences/applicationManager.properties (%chrome/browser/preferences/applicationManager.properties)
     locale/browser/preferences/colors.dtd             (%chrome/browser/preferences/colors.dtd)
     locale/browser/preferences/cookies.dtd            (%chrome/browser/preferences/cookies.dtd)
     locale/browser/preferences/content.dtd            (%chrome/browser/preferences/content.dtd)
     locale/browser/preferences/connection.dtd         (%chrome/browser/preferences/connection.dtd)
     locale/browser/preferences/applications.dtd       (%chrome/browser/preferences/applications.dtd)
-    locale/browser/preferences/fallbackEULA.dtd       (%chrome/browser/preferences/fallbackEULA.dtd)
     locale/browser/preferences/fonts.dtd              (%chrome/browser/preferences/fonts.dtd)
     locale/browser/preferences/main.dtd               (%chrome/browser/preferences/main.dtd)
     locale/browser/preferences/languages.dtd          (%chrome/browser/preferences/languages.dtd)
     locale/browser/preferences/permissions.dtd        (%chrome/browser/preferences/permissions.dtd)
-    locale/browser/preferences/phishEULA.dtd          (%chrome/browser/preferences/phishEULA.dtd)
     locale/browser/preferences/preferences.dtd        (%chrome/browser/preferences/preferences.dtd)
     locale/browser/preferences/preferences.properties (%chrome/browser/preferences/preferences.properties)
     locale/browser/preferences/privacy.dtd            (%chrome/browser/preferences/privacy.dtd)
     locale/browser/preferences/security.dtd           (%chrome/browser/preferences/security.dtd)
     locale/browser/preferences/securityWarnings.dtd   (%chrome/browser/preferences/securityWarnings.dtd)
     locale/browser/preferences/tabs.dtd               (%chrome/browser/preferences/tabs.dtd)
     locale/browser/sidebar/sidebar.properties      (%chrome/browser/sidebar/sidebar.properties)
 % locale browser-region @AB_CD@ %locale/browser-region/