Bug 731546 - Add link to marketplace on about:home. r=mak
authorFrank Yan <fyan@mozilla.com>
Fri, 23 Mar 2012 07:12:34 -0700
changeset 93441 5ff4f574298e76cb6dd5633acec5c16a7b7edfc8
parent 93233 652a5c8a24b665033929ba3bb106655dbcafc8ec
child 93442 4173214920c3dab17c187375eb53b73e95eea3c6
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs731546
milestone14.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 731546 - Add link to marketplace on about:home. r=mak
browser/base/content/abouthome/aboutHome.css
browser/base/content/abouthome/aboutHome.xhtml
browser/base/content/abouthome/apps.png
browser/base/content/browser.js
browser/base/jar.mn
--- a/browser/base/content/abouthome/aboutHome.css
+++ b/browser/base/content/abouthome/aboutHome.css
@@ -250,16 +250,17 @@ body[narrow] #launcher[session] > .launc
 .launchButton:hover:active {
   background-image: -moz-linear-gradient(hsla(211,79%,6%,.02), hsla(211,79%,6%,.05));
   border-color: hsla(210,54%,20%,.2) hsla(210,54%,20%,.23) hsla(210,54%,20%,.25);
   box-shadow: 0 1px 1px hsla(211,79%,6%,.05) inset,
               0 0 1px hsla(211,79%,6%,.1) inset;
   -moz-transition-duration: 0ms;
 }
 
+.launchButton[hidden],
 #launcher:not([session]) > #restorePreviousSessionSeparator,
 #launcher:not([session]) > #restorePreviousSession {
   display: none;
 }
 
 #restorePreviousSessionSeparator {
   width: 3px;
   height: 116px;
@@ -293,38 +294,42 @@ body[narrow] #restorePreviousSession {
 
 .launchButton::before {
   display: block;
   height: 32px;
   margin-bottom: 6px;
   line-height: 0; /* remove extra vertical space due to non-zero font-size */
 }
 
+#downloads::before {
+  content: url("chrome://browser/content/abouthome/downloads.png");
+}
+
 #bookmarks::before {
   content: url("chrome://browser/content/abouthome/bookmarks.png");
 }
 
 #history::before {
   content: url("chrome://browser/content/abouthome/history.png");
 }
 
-#settings::before {
-  content: url("chrome://browser/content/abouthome/settings.png");
+#apps::before {
+  content: url("chrome://browser/content/abouthome/apps.png");
 }
 
 #addons::before {
   content: url("chrome://browser/content/abouthome/addons.png");
 }
 
-#downloads::before {
-  content: url("chrome://browser/content/abouthome/downloads.png");
+#sync::before {
+  content: url("chrome://browser/content/abouthome/sync.png");
 }
 
-#sync::before {
-  content: url("chrome://browser/content/abouthome/sync.png");
+#settings::before {
+  content: url("chrome://browser/content/abouthome/settings.png");
 }
 
 #restorePreviousSession::before {
   content: url("chrome://browser/content/abouthome/restore-large.png");
   height: 48px;
   width: 48px;
   display: inline-block; /* display on same line as text label */
   vertical-align: middle;
--- a/browser/base/content/abouthome/aboutHome.xhtml
+++ b/browser/base/content/abouthome/aboutHome.xhtml
@@ -86,21 +86,22 @@
           <span id="defaultSnippet2">&abouthome.defaultSnippet2.v1;</span>
         </div>
         <div id="snippets"/>
       </div>
     </div>
     <div class="spacer"/>
 
     <div id="launcher" session="true">
+      <button class="launchButton" id="downloads">&abouthome.downloadsButton.label;</button>
       <button class="launchButton" id="bookmarks">&abouthome.bookmarksButton.label;</button>
       <button class="launchButton" id="history">&abouthome.historyButton.label;</button>
-      <button class="launchButton" id="settings">&abouthome.settingsButton.label;</button>
+      <button class="launchButton" id="apps" hidden="true">&abouthome.appsButton.label;</button>
       <button class="launchButton" id="addons">&abouthome.addonsButton.label;</button>
-      <button class="launchButton" id="downloads">&abouthome.downloadsButton.label;</button>
       <button class="launchButton" id="sync">&syncBrand.shortName.label;</button>
+      <button class="launchButton" id="settings">&abouthome.settingsButton.label;</button>
       <div id="restorePreviousSessionSeparator"/>
       <button class="launchButton" id="restorePreviousSession">&historyRestoreLastSession.label;</button>
     </div>
 
-    <a id="aboutMozilla" href="http://www.mozilla.com/about/"/>
+    <a id="aboutMozilla" href="http://www.mozilla.org/about/"/>
   </body>
 </html>
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..c6907b2006fa30d7aec833e3cff99706014babac
GIT binary patch
literal 438
zc$@*Y0ZIOeP)<h;3K|Lk000e1NJLTq001BW001Be1^@s6b9#F80004fNkl<ZSi`kf
z%Wi})44j~@T4^bdo*{()|H&RYM%jqP4sjz{LMXAvPVBLPzZC#{0T?Ks{O7eg>L1Va
z2LMk13xJ&xx!D6mpstwdUuhE{vfQ{x0x&g#2-J~I^sfLOAiDjHBmgr*cqi=h8{;B9
zcqjXXY&SrN@lDa)gAZa+q7VW67(sO08x`-5D+ojq4Is2gi07K|O}x(^%b<iTDc6yQ
zT{AwMJ?=bRk^-d6j;q&RM)5Me1;lDlCW_>YwtuzOmX6+7BQY91pK3BG2eCIwwej*g
zwg%&yM@b)UMk4a83z>XZf`~lh#;8Hzj8Z1}()p3+RsiFFc%Lc&Brgz_3RhDx-TB-C
z;#NOl<#TH-m}{$`h0i6=wTfBQPgwa}^4wY{O#MU)pEvgt9(-QgPjtEGgA<?E_7lfk
zV7WglrCR%mXqgM{^0~F2Q0IacKDYD}mvey^pTFxTUgm;wI9-U&YdGx-{V&6*tPgJN
g`R%=O{SW#13ymv4XFC>~ZvX%Q07*qoM6N<$g36e}C;$Ke
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -2702,16 +2702,20 @@ function PageProxyClickHandler(aEvent)
 }
 
 /**
  *  Handle load of some pages (about:*) so that we can make modifications
  *  to the DOM for unprivileged pages.
  */
 function BrowserOnAboutPageLoad(document) {
   if (/^about:home$/i.test(document.documentURI)) {
+    // XXX bug 738646 - when Marketplace is launched, remove this statement and
+    // the hidden attribute set on the apps button in aboutHome.xhtml
+    if (getBoolPref("browser.aboutHome.apps", false))
+      document.getElementById("apps").removeAttribute("hidden");
     let ss = Components.classes["@mozilla.org/browser/sessionstore;1"].
              getService(Components.interfaces.nsISessionStore);
     if (!ss.canRestoreLastSession)
       document.getElementById("launcher").removeAttribute("session");
   }
 }
 
 /**
@@ -2844,34 +2848,37 @@ function BrowserOnClick(event) {
     else if (/^about:home$/i.test(ownerDoc.documentURI)) {
       if (ot == ownerDoc.getElementById("restorePreviousSession")) {
         let ss = Cc["@mozilla.org/browser/sessionstore;1"].
                  getService(Ci.nsISessionStore);
         if (ss.canRestoreLastSession)
           ss.restoreLastSession();
         ownerDoc.getElementById("launcher").removeAttribute("session");
       }
+      else if (ot == ownerDoc.getElementById("downloads")) {
+        BrowserDownloadsUI();
+      }
       else if (ot == ownerDoc.getElementById("bookmarks")) {
         PlacesCommandHook.showPlacesOrganizer("AllBookmarks");
       }
       else if (ot == ownerDoc.getElementById("history")) {
         PlacesCommandHook.showPlacesOrganizer("History");
       }
-      else if (ot == ownerDoc.getElementById("settings")) {
-        openPreferences();
+      else if (ot == ownerDoc.getElementById("apps")) {
+        openUILinkIn("https://marketplace.mozilla.org/", "tab");
       }
       else if (ot == ownerDoc.getElementById("addons")) {
         BrowserOpenAddonsMgr();
       }
-      else if (ot == ownerDoc.getElementById("downloads")) {
-        BrowserDownloadsUI();
-      }
       else if (ot == ownerDoc.getElementById("sync")) {
         openPreferences("paneSync");
       }
+      else if (ot == ownerDoc.getElementById("settings")) {
+        openPreferences();
+      }
     }
 }
 
 /**
  * Re-direct the browser to a known-safe page.  This function is
  * used when, for example, the user browses to a known malware page
  * and is presented with about:blocked.  The "Get me out of here!"
  * button should take the user to the default start page so that even
--- a/browser/base/jar.mn
+++ b/browser/base/jar.mn
@@ -16,22 +16,23 @@ browser.jar:
 *       content/browser/aboutDialog.js                (content/aboutDialog.js)
 *       content/browser/aboutDialog.css               (content/aboutDialog.css)
 *       content/browser/aboutRobots.xhtml             (content/aboutRobots.xhtml)
 *       content/browser/abouthome/aboutHome.xhtml     (content/abouthome/aboutHome.xhtml)
 *       content/browser/abouthome/aboutHome.js        (content/abouthome/aboutHome.js)
 *       content/browser/abouthome/aboutHome.css       (content/abouthome/aboutHome.css)
         content/browser/abouthome/snippet1.png        (content/abouthome/snippet1.png)
         content/browser/abouthome/snippet2.png        (content/abouthome/snippet2.png)
+        content/browser/abouthome/downloads.png       (content/abouthome/downloads.png)
         content/browser/abouthome/bookmarks.png       (content/abouthome/bookmarks.png)
         content/browser/abouthome/history.png         (content/abouthome/history.png)
-        content/browser/abouthome/settings.png        (content/abouthome/settings.png)
+        content/browser/abouthome/apps.png            (content/abouthome/apps.png)
         content/browser/abouthome/addons.png          (content/abouthome/addons.png)
-        content/browser/abouthome/downloads.png       (content/abouthome/downloads.png)
         content/browser/abouthome/sync.png            (content/abouthome/sync.png)
+        content/browser/abouthome/settings.png        (content/abouthome/settings.png)
         content/browser/abouthome/restore.png         (content/abouthome/restore.png)
         content/browser/abouthome/restore-large.png   (content/abouthome/restore-large.png)
         content/browser/abouthome/mozilla.png         (content/abouthome/mozilla.png)
         content/browser/abouthome/noise.png           (content/abouthome/noise.png)
         content/browser/aboutRobots-icon.png          (content/aboutRobots-icon.png)
         content/browser/aboutRobots-widget-left.png   (content/aboutRobots-widget-left.png)
 *       content/browser/browser.css                   (content/browser.css)
 *       content/browser/browser.js                    (content/browser.js)