Bug 1336434 - "Your Top Sites" heading should say "Top Sites" instead when using the default set. r=Gijs
authorDão Gottwald <dao@mozilla.com>
Tue, 14 Feb 2017 12:39:11 +0100
changeset 342733 d65e47dee9a4acb0026cb8b7d2360d1050dea656
parent 342732 e5b189f0363b3db64159e6629a25ce8109097e5f
child 342734 809580f09e6ba0f4c8639ef96d1432b3c5654cb0
push id31362
push userkwierso@gmail.com
push dateTue, 14 Feb 2017 20:55:38 +0000
treeherdermozilla-central@c5a25b056d1e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1336434
milestone54.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 1336434 - "Your Top Sites" heading should say "Top Sites" instead when using the default set. r=Gijs MozReview-Commit-ID: 3TXSxKSqgJy
browser/base/content/newtab/grid.js
browser/base/content/newtab/newTab.xhtml
browser/locales/en-US/chrome/browser/newTab.dtd
browser/locales/en-US/chrome/browser/newTab.properties
--- a/browser/base/content/newtab/grid.js
+++ b/browser/base/content/newtab/grid.js
@@ -137,27 +137,34 @@ var gGrid = {
     // Create cells.
     let cells = Array.from(fragment.childNodes, (cell) => new Cell(this, cell));
 
     // Fetch links.
     let links = gLinks.getLinks();
 
     // Create sites.
     let numLinks = Math.min(links.length, cells.length);
+    let hasHistoryTiles = false;
     for (let i = 0; i < numLinks; i++) {
       if (links[i]) {
         this.createSite(links[i], cells[i]);
+        if (links[i].type == "history") {
+          hasHistoryTiles = true;
+        }
       }
     }
 
     this._cells = cells;
     while (this._gridDefaultContent.nextSibling) {
       this._gridDefaultContent.nextSibling.remove();
     }
     this._node.appendChild(fragment);
+
+    document.getElementById("topsites-heading").textContent =
+      newTabString(hasHistoryTiles ? "userTopSites.heading" : "defaultTopSites.heading");
   },
 
   /**
    * Calculate the height for a number of rows up to the maximum rows
    * @param rows Number of rows defaulting to the max
    */
   _computeHeight: function Grid_computeHeight(aRows) {
     let {gridRows} = gGridPrefs;
--- a/browser/base/content/newtab/newTab.xhtml
+++ b/browser/base/content/newtab/newTab.xhtml
@@ -75,17 +75,17 @@
         <input id="newtab-search-submit" type="button"
              title="&contentSearchSubmit.tooltip;"/>
       </div>
     </div>
 
     <div id="newtab-horizontal-margin">
       <div class="newtab-side-margin"/>
       <div id="newtab-grid">
-        <h1 id="topsites-heading">&newtab.topSites.heading;</h1>
+        <h1 id="topsites-heading"/>
       </div>
       <div class="newtab-side-margin"/>
     </div>
 
     <div id="newtab-margin-bottom"/>
   </div>
   <input id="newtab-customize-button" type="button" dir="&locale.dir;"
          value="&#x2699;"
--- a/browser/locales/en-US/chrome/browser/newTab.dtd
+++ b/browser/locales/en-US/chrome/browser/newTab.dtd
@@ -1,15 +1,14 @@
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <!-- These strings are used in the about:newtab page -->
 <!ENTITY newtab.pageTitle "New Tab">
-<!ENTITY newtab.topSites.heading "Your Top Sites">
 <!ENTITY newtab.customize.classic "Show your top sites">
 <!ENTITY newtab.customize.cog.enhanced "Include suggested sites">
 <!ENTITY newtab.customize.cog.title2 "NEW TAB CONTROLS">
 <!ENTITY newtab.customize.cog.learn "Learn about New Tab">
 <!ENTITY newtab.customize.title "Customize your New Tab page">
 <!ENTITY newtab.customize.suggested "Show suggested and your top sites">
 <!ENTITY newtab.customize.topsites "Show your top sites">
 <!ENTITY newtab.customize.blank2 "Show blank page">
--- a/browser/locales/en-US/chrome/browser/newTab.properties
+++ b/browser/locales/en-US/chrome/browser/newTab.properties
@@ -1,12 +1,15 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+newtab.defaultTopSites.heading=Top Sites
+newtab.userTopSites.heading=Your Top Sites
+
 newtab.pin=Pin this site at its current position
 newtab.unpin=Unpin this site
 newtab.block=Remove this site
 # LOCALIZATION NOTE(newtab.sponsored.button): This text appears for sponsored
 # and enhanced tiles on the same line as the tile's title, so prefer short
 # strings to avoid overlap. This string should be uppercase.
 newtab.sponsored.button=SPONSORED
 # LOCALIZATION NOTE(newtab.suggested.button): This text appears for sponsored