Bug 513023 - Move about:rights content to toolkit. r=benjamin
authorGavin Sharp <gavin.sharp@gmail.com>
Fri, 04 Sep 2009 14:27:14 +0200
changeset 32234 0925624977a2d9917ed29a3de8c4777d61f03073
parent 32233 c390b81acd94a25307aa4e4d9314f2e332b666fd
child 32235 53c42b6f8311e896a236cbece75563b4733745e9
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbenjamin
bugs513023
milestone1.9.3a1pre
Bug 513023 - Move about:rights content to toolkit. r=benjamin
browser/base/Makefile.in
browser/base/content/aboutRights.xhtml
browser/base/jar.mn
browser/components/about/AboutRedirector.cpp
browser/components/about/Makefile.in
browser/components/nsBrowserGlue.js
browser/locales/en-US/chrome/browser/aboutRights.dtd
browser/locales/en-US/chrome/browser/aboutRights.properties
browser/locales/jar.mn
toolkit/content/aboutRights-unbranded.xhtml
toolkit/content/aboutRights.xhtml
toolkit/content/jar.mn
toolkit/locales/en-US/chrome/global/aboutRights.dtd
toolkit/locales/en-US/chrome/global/aboutRights.properties
toolkit/locales/jar.mn
--- a/browser/base/Makefile.in
+++ b/browser/base/Makefile.in
@@ -76,12 +76,8 @@ ifdef MOZ_UPDATER
 DEFINES += -DMOZ_UPDATER=1
 endif
 
 ifneq (,$(filter windows mac cocoa gtk2, $(MOZ_WIDGET_TOOLKIT)))
 ifneq ($(OS_ARCH),WINCE)
 DEFINES += -DCONTEXT_COPY_IMAGE_CONTENTS=1
 endif
 endif
-
-ifdef MOZILLA_OFFICIAL
-DEFINES += -DOFFICIAL_BUILD=1
-endif
--- a/browser/base/jar.mn
+++ b/browser/base/jar.mn
@@ -8,17 +8,16 @@ browser.jar:
 #endif
 %  overlay chrome://global/content/viewSource.xul chrome://browser/content/viewSourceOverlay.xul
 %  overlay chrome://global/content/viewPartialSource.xul chrome://browser/content/viewSourceOverlay.xul
 %  style chrome://global/content/customizeToolbar.xul chrome://browser/content/browser.css
 %  style chrome://global/content/customizeToolbar.xul chrome://browser/skin/
 *       content/browser/aboutDialog.xul               (content/aboutDialog.xul)
 *       content/browser/aboutDialog.js                (content/aboutDialog.js)
         content/browser/aboutDialog.css               (content/aboutDialog.css)
-*       content/browser/aboutRights.xhtml             (content/aboutRights.xhtml)
 *       content/browser/aboutRobots.xhtml             (content/aboutRobots.xhtml)
         content/browser/aboutRobots-icon.png          (content/aboutRobots-icon.png)
         content/browser/aboutRobots-icon-rtl.png      (content/aboutRobots-icon-rtl.png)
         content/browser/aboutRobots-widget-left.png   (content/aboutRobots-widget-left.png)
         content/browser/aboutRobots-widget-right.png  (content/aboutRobots-widget-right.png)
 *       content/browser/browser.css                   (content/browser.css)
 *       content/browser/browser.js                    (content/browser.js)
 *       content/browser/browser.xul                   (content/browser.xul)
--- a/browser/components/about/AboutRedirector.cpp
+++ b/browser/components/about/AboutRedirector.cpp
@@ -75,17 +75,22 @@ static RedirEntry kRedirMap[] = {
   { "certerror", "chrome://browser/content/certerror/aboutCertError.xhtml",
     nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
     nsIAboutModule::ALLOW_SCRIPT },
   { "feeds", "chrome://browser/content/feeds/subscribe.xhtml",
     nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
     nsIAboutModule::ALLOW_SCRIPT },
   { "privatebrowsing", "chrome://browser/content/aboutPrivateBrowsing.xhtml",
     nsIAboutModule::ALLOW_SCRIPT },
-  { "rights", "chrome://browser/content/aboutRights.xhtml",
+  { "rights",
+#ifdef OFFICIAL_BUILD
+    "chrome://global/content/aboutRights.xhtml",
+#else
+    "chrome://global/content/aboutRights-unbranded.xhtml",
+#endif
     nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
     nsIAboutModule::ALLOW_SCRIPT },
   { "robots", "chrome://browser/content/aboutRobots.xhtml",
     nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
     nsIAboutModule::ALLOW_SCRIPT },
   { "sessionrestore", "chrome://browser/content/aboutSessionRestore.xhtml",
     nsIAboutModule::ALLOW_SCRIPT }
 };
--- a/browser/components/about/Makefile.in
+++ b/browser/components/about/Makefile.in
@@ -53,9 +53,13 @@ endif
 EXPORTS_NAMESPACES = mozilla/browser
 
 EXPORTS_mozilla/browser = AboutRedirector.h
 
 CPPSRCS = AboutRedirector.cpp
 
 LOCAL_INCLUDES = -I$(srcdir)/../build
 
+ifdef MOZILLA_OFFICIAL
+DEFINES += -DOFFICIAL_BUILD=1
+endif
+
 include $(topsrcdir)/config/rules.mk
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -489,17 +489,17 @@ BrowserGlue.prototype = {
 
   _showRightsNotification : function () {
     // 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 brandBundle  = this._bundleService.createBundle("chrome://branding/locale/brand.properties");
-    var rightsBundle = this._bundleService.createBundle("chrome://browser/locale/aboutRights.properties");
+    var rightsBundle = this._bundleService.createBundle("chrome://global/locale/aboutRights.properties");
 
     var buttonLabel      = rightsBundle.GetStringFromName("buttonLabel");
     var buttonAccessKey  = rightsBundle.GetStringFromName("buttonAccessKey");
     var productName      = brandBundle.GetStringFromName("brandFullName");
     var notifyRightsText = rightsBundle.formatStringFromName("notifyRightsText", [productName], 1);
     
     var buttons = [
                     {
--- a/browser/locales/jar.mn
+++ b/browser/locales/jar.mn
@@ -1,17 +1,15 @@
 #filter substitution
 
 @AB_CD@.jar:
 % locale browser @AB_CD@ %locale/browser/
     locale/browser/aboutCertError.dtd              (%chrome/browser/aboutCertError.dtd)
     locale/browser/aboutDialog.dtd                 (%chrome/browser/aboutDialog.dtd)
     locale/browser/aboutPrivateBrowsing.dtd        (%chrome/browser/aboutPrivateBrowsing.dtd)
-    locale/browser/aboutRights.dtd                 (%chrome/browser/aboutRights.dtd)
-    locale/browser/aboutRights.properties          (%chrome/browser/aboutRights.properties)
     locale/browser/aboutRobots.dtd                 (%chrome/browser/aboutRobots.dtd)
     locale/browser/aboutSessionRestore.dtd         (%chrome/browser/aboutSessionRestore.dtd)
     locale/browser/credits.dtd                     (%chrome/browser/credits.dtd)
 *   locale/browser/browser.dtd                     (%chrome/browser/browser.dtd)
     locale/browser/baseMenuOverlay.dtd             (%chrome/browser/baseMenuOverlay.dtd)
     locale/browser/browser.properties              (%chrome/browser/browser.properties)
     locale/browser/openLocation.dtd                (%chrome/browser/openLocation.dtd)
     locale/browser/openLocation.properties         (%chrome/browser/openLocation.properties)
rename from browser/base/content/aboutRights.xhtml
rename to toolkit/content/aboutRights-unbranded.xhtml
--- a/browser/base/content/aboutRights.xhtml
+++ b/toolkit/content/aboutRights-unbranded.xhtml
@@ -1,17 +1,17 @@
 <?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 % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
   %brandDTD;
   <!ENTITY % securityPrefsDTD SYSTEM "chrome://browser/locale/preferences/security.dtd">
   %securityPrefsDTD;
-  <!ENTITY % aboutRightsDTD SYSTEM "chrome://browser/locale/aboutRights.dtd">
+  <!ENTITY % aboutRightsDTD SYSTEM "chrome://global/locale/aboutRights.dtd">
   %aboutRightsDTD;
 ]>
 # ***** 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
@@ -56,52 +56,32 @@
 <body id="your-rights" dir="&rights.locale-direction;" class="aboutPageWideContainer">
 
 <h1>&rights.intro-header;</h1>
 
 <p>&rights.intro;</p>
 
 <ul>
   <li>&rights.intro-point1a;<a href="http://www.mozilla.org/MPL/">&rights.intro-point1b;</a>&rights.intro-point1c;</li>
-#ifdef OFFICIAL_BUILD
 # Point 2 discusses Mozilla trademarks, and isn't needed when the build is unbranded.
 # Point 3 discusses privacy policy, unbranded builds get a placeholder (for the vendor to replace)
 # Point 4 discusses web service terms, unbranded builds gets a placeholder (for the vendor to replace)
-  <li>&rights.intro-point2a;<a href="http://www.mozilla.org/foundation/trademarks/policy.html">&rights.intro-point2b;</a>&rights.intro-point2c;</li>
-  <li>&rights.intro-point3a;<a href="http://www.mozilla.com/legal/privacy/">&rights.intro-point3b;</a>&rights.intro-point3c;</li>
-  <li>&rights.intro-point4a;<a href="about:rights#webservices" onclick="showServices();">&rights.intro-point4b;</a>&rights.intro-point4c;</li>
-#else
   <li>&rights.intro-point3-unbranded;</li>
   <li>&rights.intro-point4a-unbranded;<a href="about:rights#webservices" onclick="showServices();">&rights.intro-point4b-unbranded;</a>&rights.intro-point4c-unbranded;</li>
-#endif
 </ul>
 
 <div id="webservices-container">
   <a name="webservices"/>
   <h3>&rights.webservices-header;</h3>
 
-#ifdef OFFICIAL_BUILD
-  <p>&rights.webservices-a;<code>&rights.webservices-b;</code>&rights.webservices-c;</p>
-#else
   <p>&rights.webservices-unbranded;</p>
-#endif
 
   <ol>
-#ifdef OFFICIAL_BUILD
 # Terms only apply to official builds, unbranded builds get a placeholder.
-    <li>&rights.webservices-term1;</li>
-    <li>&rights.webservices-term2;</li>
-    <li>&rights.webservices-term3;</li>
-    <li><strong>&rights.webservices-term4;</strong></li>
-    <li><strong>&rights.webservices-term5;</strong></li>
-    <li>&rights.webservices-term6;</li>
-    <li>&rights.webservices-term7;</li>
-#else
     <li>&rights.webservices-term1-unbranded;</li>
-#endif
   </ol>
 </div>
 
 <script type="application/x-javascript"><![CDATA[
   var servicesDiv = document.getElementById("webservices-container");
   servicesDiv.style.display = "none";
 
   function showServices() {
copy from browser/base/content/aboutRights.xhtml
copy to toolkit/content/aboutRights.xhtml
--- a/browser/base/content/aboutRights.xhtml
+++ b/toolkit/content/aboutRights.xhtml
@@ -1,17 +1,17 @@
 <?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 % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
   %brandDTD;
   <!ENTITY % securityPrefsDTD SYSTEM "chrome://browser/locale/preferences/security.dtd">
   %securityPrefsDTD;
-  <!ENTITY % aboutRightsDTD SYSTEM "chrome://browser/locale/aboutRights.dtd">
+  <!ENTITY % aboutRightsDTD SYSTEM "chrome://global/locale/aboutRights.dtd">
   %aboutRightsDTD;
 ]>
 # ***** 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
@@ -56,52 +56,39 @@
 <body id="your-rights" dir="&rights.locale-direction;" class="aboutPageWideContainer">
 
 <h1>&rights.intro-header;</h1>
 
 <p>&rights.intro;</p>
 
 <ul>
   <li>&rights.intro-point1a;<a href="http://www.mozilla.org/MPL/">&rights.intro-point1b;</a>&rights.intro-point1c;</li>
-#ifdef OFFICIAL_BUILD
 # Point 2 discusses Mozilla trademarks, and isn't needed when the build is unbranded.
 # Point 3 discusses privacy policy, unbranded builds get a placeholder (for the vendor to replace)
 # Point 4 discusses web service terms, unbranded builds gets a placeholder (for the vendor to replace)
   <li>&rights.intro-point2a;<a href="http://www.mozilla.org/foundation/trademarks/policy.html">&rights.intro-point2b;</a>&rights.intro-point2c;</li>
   <li>&rights.intro-point3a;<a href="http://www.mozilla.com/legal/privacy/">&rights.intro-point3b;</a>&rights.intro-point3c;</li>
   <li>&rights.intro-point4a;<a href="about:rights#webservices" onclick="showServices();">&rights.intro-point4b;</a>&rights.intro-point4c;</li>
-#else
-  <li>&rights.intro-point3-unbranded;</li>
-  <li>&rights.intro-point4a-unbranded;<a href="about:rights#webservices" onclick="showServices();">&rights.intro-point4b-unbranded;</a>&rights.intro-point4c-unbranded;</li>
-#endif
 </ul>
 
 <div id="webservices-container">
   <a name="webservices"/>
   <h3>&rights.webservices-header;</h3>
 
-#ifdef OFFICIAL_BUILD
   <p>&rights.webservices-a;<code>&rights.webservices-b;</code>&rights.webservices-c;</p>
-#else
-  <p>&rights.webservices-unbranded;</p>
-#endif
 
   <ol>
-#ifdef OFFICIAL_BUILD
 # Terms only apply to official builds, unbranded builds get a placeholder.
     <li>&rights.webservices-term1;</li>
     <li>&rights.webservices-term2;</li>
     <li>&rights.webservices-term3;</li>
     <li><strong>&rights.webservices-term4;</strong></li>
     <li><strong>&rights.webservices-term5;</strong></li>
     <li>&rights.webservices-term6;</li>
     <li>&rights.webservices-term7;</li>
-#else
-    <li>&rights.webservices-term1-unbranded;</li>
-#endif
   </ol>
 </div>
 
 <script type="application/x-javascript"><![CDATA[
   var servicesDiv = document.getElementById("webservices-container");
   servicesDiv.style.display = "none";
 
   function showServices() {
--- a/toolkit/content/jar.mn
+++ b/toolkit/content/jar.mn
@@ -6,16 +6,18 @@ toolkit.jar:
 # work with Geckos from before 1.9, when there was a separate file
 %  override chrome://global/content/nsTransferable.js chrome://global/content/nsDragAndDrop.js
 *  content/global/license.html                (license.html)
    content/global/XPCNativeWrapper.js         (XPCNativeWrapper.js)
 *  content/global/xul.css                     (xul.css)
    content/global/textbox.css                 (textbox.css)
    content/global/menulist.css                (menulist.css)
 *  content/global/about.xhtml                 (about.xhtml)
+*  content/global/aboutRights.xhtml           (aboutRights.xhtml)
+*  content/global/aboutRights-unbranded.xhtml (aboutRights-unbranded.xhtml)
    content/global/directionDetector.html
    content/global/plugins.html
    content/global/plugins.css
 *+  content/global/buildconfig.html            (buildconfig.html)
 +  content/global/charsetOverlay.js           (charsetOverlay.js)
 +  content/global/charsetOverlay.xul          (charsetOverlay.xul)
 *+ content/global/commonDialog.js             (commonDialog.js)
 *+ content/global/commonDialog.xul            (commonDialog.xul)
rename from browser/locales/en-US/chrome/browser/aboutRights.dtd
rename to toolkit/locales/en-US/chrome/global/aboutRights.dtd
rename from browser/locales/en-US/chrome/browser/aboutRights.properties
rename to toolkit/locales/en-US/chrome/global/aboutRights.properties
--- a/toolkit/locales/jar.mn
+++ b/toolkit/locales/jar.mn
@@ -1,13 +1,15 @@
 #filter substitution
 
 @AB_CD@.jar:
 % locale global @AB_CD@ %locale/@AB_CD@/global/
   locale/@AB_CD@/global/about.dtd                       (%chrome/global/about.dtd)
+  locale/@AB_CD@/global/aboutRights.dtd                 (%chrome/global/aboutRights.dtd)
+  locale/@AB_CD@/global/aboutRights.properties          (%chrome/global/aboutRights.properties)
   locale/@AB_CD@/global/appPicker.dtd                   (%chrome/global/appPicker.dtd)
   locale/@AB_CD@/global/brand.dtd                       (generic/chrome/global/brand.dtd)
 + locale/@AB_CD@/global/browser.properties              (%chrome/global/browser.properties)
 + locale/@AB_CD@/global/charsetOverlay.dtd              (%chrome/global/charsetOverlay.dtd)
 + locale/@AB_CD@/global/commonDialog.dtd                (%chrome/global/commonDialog.dtd)
 + locale/@AB_CD@/global/commonDialogs.properties        (%chrome/global/commonDialogs.properties)
 + locale/@AB_CD@/global/config.dtd                      (%chrome/global/config.dtd)
 + locale/@AB_CD@/global/config.properties               (%chrome/global/config.properties)