Bug 1009370 - Part 3: Cleanup aboutPrivateBrowsing.xhtml. r=Unfocused
authorBirunthan Mohanathas <birunthan@mohanathas.com>
Tue, 26 Aug 2014 07:11:11 -0700
changeset 201594 27e503753e0073f7a2eedad0f0e4276b844d028c
parent 201593 8f5ad2b5a7755f5772bca4559ea8624eb6b39c29
child 201595 2964a815862e3c94c0581631d0c72a212c39ad78
push id48220
push userbirunthan@mohanathas.com
push dateTue, 26 Aug 2014 14:11:48 +0000
treeherdermozilla-inbound@2964a815862e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersUnfocused
bugs1009370
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1009370 - Part 3: Cleanup aboutPrivateBrowsing.xhtml. r=Unfocused
browser/components/privatebrowsing/content/aboutPrivateBrowsing.css
browser/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml
--- a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.css
+++ b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.css
@@ -10,16 +10,21 @@ body {
   display: flex;
   box-sizing: padding-box;
   min-height: 100vh;
   padding: 0 48px;
   align-items: center;
   justify-content: center;
 }
 
+body.normal .showPrivate,
+body.private .showNormal {
+  display: none;
+}
+
 #pageContainer {
   min-width: 320px;
   max-width: 512px;
 }
 
 .titleText {
   background: url("chrome://browser/skin/mask.png") left 0 no-repeat;
   background-size: 45px;
--- a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml
+++ b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml
@@ -15,27 +15,20 @@
   %browserDTD;
   <!ENTITY % aboutPrivateBrowsingDTD SYSTEM "chrome://browser/locale/aboutPrivateBrowsing.dtd">
   %aboutPrivateBrowsingDTD;
 ]>
 
 <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
     <link rel="stylesheet" href="chrome://browser/content/aboutPrivateBrowsing.css" type="text/css" media="all"/>
-    <style type="text/css"><![CDATA[
-      body.normal .showPrivate,
-      body.private .showNormal {
-        display: none;
-      }
-    ]]></style>
     <script type="application/javascript;version=1.7"><![CDATA[
-      const Cc = Components.classes;
-      const Ci = Components.interfaces;
+      const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 
-      Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
+      Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
 
       if (!PrivateBrowsingUtils.isWindowPrivate(window)) {
         document.title = "]]>&aboutPrivateBrowsing.title.normal;<![CDATA[";
         setFavIcon("chrome://global/skin/icons/question-16.png");
       } else {
 #ifndef XP_MACOSX
         document.title = "]]>&aboutPrivateBrowsing.title;<![CDATA[";
 #endif
@@ -59,71 +52,47 @@
       }
 
       document.addEventListener("DOMContentLoaded", function () {
         if (!PrivateBrowsingUtils.isWindowPrivate(window)) {
           document.body.setAttribute("class", "normal");
         }
 
         // Set up the help link
-        let moreInfoURL = Cc["@mozilla.org/toolkit/URLFormatterService;1"].
-                          getService(Ci.nsIURLFormatter).
-                          formatURLPref("app.support.baseURL");
-        let moreInfoLink = document.getElementById("moreInfoLink");
-        if (moreInfoLink)
-          moreInfoLink.setAttribute("href", moreInfoURL + "private-browsing");
+        let learnMoreURL = Cc["@mozilla.org/toolkit/URLFormatterService;1"]
+                           .getService(Ci.nsIURLFormatter)
+                           .formatURLPref("app.support.baseURL");
+        let learnMore = document.getElementById("learnMore");
+        if (learnMore) {
+          learnMore.setAttribute("href", learnMoreURL + "private-browsing");
+        }
       }, false);
 
       function openPrivateWindow() {
         mainWindow.OpenBrowserWindow({private: true});
       }
     ]]></script>
   </head>
 
-  <body dir="&locale.dir;"
-        class="private">
-
-    <!-- PAGE CONTAINER (for styling purposes only) -->
+  <body dir="&locale.dir;" class="private">
     <div id="pageContainer">
+      <h1 class="titleText showPrivate">&aboutPrivateBrowsing.title;</h1>
+      <h1 class="titleText showNormal">&aboutPrivateBrowsing.title.normal;</h1>
 
-      <!-- Error Title -->
-      <div id="errorTitle">
-        <h1 class="titleText showPrivate">&aboutPrivateBrowsing.title;</h1>
-        <h1 class="titleText showNormal">&aboutPrivateBrowsing.title.normal;</h1>
-      </div>
+      <p class="showPrivate">&aboutPrivateBrowsing.subtitle;</p>
+      <p class="showNormal">&aboutPrivateBrowsing.subtitle.normal;</p>
 
-      <!-- LONG CONTENT (the section most likely to require scrolling) -->
-      <div id="errorLongContent">
-
-        <!-- Short Description -->
-        <div id="errorShortDesc">
-          <p id="errorShortDescText" class="showPrivate">&aboutPrivateBrowsing.subtitle;</p>
-          <p id="errorShortDescTextNormal" class="showNormal">&aboutPrivateBrowsing.subtitle.normal;</p>
-        </div>
+      <p>&aboutPrivateBrowsing.description;</p>
 
-        <!-- Long Description -->
-        <div id="errorLongDesc">
-          <p id="errorLongDescText">&aboutPrivateBrowsing.description;</p>
-        </div>
-
-        <p class="showNormal">&aboutPrivateBrowsing.notPrivate;</p>
+      <p class="showNormal">&aboutPrivateBrowsing.notPrivate;</p>
 
-        <!-- Start Private Browsing -->
-        <button xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-                id="startPrivateBrowsing" class="showNormal"
-                label="&privatebrowsingpage.openPrivateWindow.label;"
-                accesskey="&privatebrowsingpage.openPrivateWindow.accesskey;"
-                oncommand="openPrivateWindow();"/>
-
-        <!-- More Info -->
-        <div id="moreInfo" class="showPrivate">
-          <p id="moreInfoText">
-            &aboutPrivateBrowsing.moreInfo;
-          </p>
-          <p id="moreInfoLinkContainer">
-            <a id="moreInfoLink" target="_blank">&aboutPrivateBrowsing.learnMore;</a>
-          </p>
-        </div>
+      <button xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+              class="showNormal"
+              label="&privatebrowsingpage.openPrivateWindow.label;"
+              accesskey="&privatebrowsingpage.openPrivateWindow.accesskey;"
+              oncommand="openPrivateWindow();"/>
+      <div class="showPrivate">
+        <p>&aboutPrivateBrowsing.moreInfo;</p>
+        <p><a id="learnMore" target="_blank">&aboutPrivateBrowsing.learnMore;</a></p>
       </div>
     </div>
-
   </body>
 </html>