Backed out changeset 35f38c39f565 (bug 1630983) for newtab failures on TopSitesFeed.jsm. CLOSED TREE
authorCosmin Sabou <csabou@mozilla.com>
Fri, 22 May 2020 00:32:17 +0300
changeset 531518 6470dd78730775c6223da8ac9f4cb9edad68beb2
parent 531517 fac6421d395d012e28c736a9035fed13fe0e598b
child 531519 8405ac2a305a16d869b0c0da87dc426df2633739
push id37440
push userabutkovits@mozilla.com
push dateFri, 22 May 2020 09:43:16 +0000
treeherdermozilla-central@fbf71e4d2e21 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1630983
milestone78.0a1
backs out35f38c39f565fac8ebef96be470456861e514cbe
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
Backed out changeset 35f38c39f565 (bug 1630983) for newtab failures on TopSitesFeed.jsm. CLOSED TREE
browser/components/newtab/lib/TopSitesFeed.jsm
--- a/browser/components/newtab/lib/TopSitesFeed.jsm
+++ b/browser/components/newtab/lib/TopSitesFeed.jsm
@@ -79,18 +79,16 @@ const FILTER_DEFAULT_SEARCH_PREF = "impr
 const SEARCH_FILTERS = [
   "google",
   "search.yahoo",
   "yahoo",
   "bing",
   "ask",
   "duckduckgo",
 ];
-const AMAZON_SEARCH_TILE_OVERRIDE_PREF =
-  "browser.newtabpage.amazonSearchTileOverride.url";
 
 function getShortURLForCurrentSearch() {
   const url = shortURL({ url: Services.search.defaultEngine.searchForm });
   return url;
 }
 
 this.TopSitesFeed = class TopSitesFeed {
   constructor() {
@@ -119,41 +117,34 @@ this.TopSitesFeed = class TopSitesFeed {
   init() {
     // If the feed was previously disabled PREFS_INITIAL_VALUES was never received
     this.refreshDefaults(
       this.store.getState().Prefs.values[DEFAULT_SITES_PREF]
     );
     this._storage = this.store.dbStorage.getDbTable("sectionPrefs");
     this.refresh({ broadcast: true });
     Services.obs.addObserver(this, "browser-search-engine-modified");
-    Services.prefs.addObserver(AMAZON_SEARCH_TILE_OVERRIDE_PREF, this);
   }
 
   uninit() {
     PageThumbs.removeExpirationFilter(this);
     Services.obs.removeObserver(this, "browser-search-engine-modified");
-    Services.prefs.removeObserver(AMAZON_SEARCH_TILE_OVERRIDE_PREF, this);
   }
 
   observe(subj, topic, data) {
     // We should update the current top sites if the search engine has been changed since
     // the search engine that gets filtered out of top sites has changed.
     if (
       topic === "browser-search-engine-modified" &&
       data === "engine-default" &&
       this.store.getState().Prefs.values[FILTER_DEFAULT_SEARCH_PREF]
     ) {
       delete this._currentSearchHostname;
       this._currentSearchHostname = getShortURLForCurrentSearch();
       this.refresh({ broadcast: true });
-    } else if (
-      topic === "nsPref:changed" &&
-      data === AMAZON_SEARCH_TILE_OVERRIDE_PREF
-    ) {
-      this.refresh({ broadcast: true });
     }
   }
 
   _dedupeKey(site) {
     return site && site.hostname;
   }
 
   refreshDefaults(sites) {
@@ -400,21 +391,16 @@ this.TopSitesFeed = class TopSitesFeed {
     // Remove adult sites if we need to
     const checkedAdult = this.store.getState().Prefs.values.filterAdult
       ? filterAdult(dedupedUnpinned)
       : dedupedUnpinned;
 
     // Insert the original pinned sites into the deduped frecent and defaults
     const withPinned = insertPinned(checkedAdult, pinned).slice(0, numItems);
 
-    const amazonSearchTileOverrideURL = Services.prefs.getCharPref(
-      AMAZON_SEARCH_TILE_OVERRIDE_PREF,
-      ""
-    );
-
     // Now, get a tippy top icon, a rich icon, or screenshot for every item
     for (const link of withPinned) {
       if (link) {
         // If there is a custom screenshot this is the only image we display
         if (link.customScreenshotURL) {
           this._fetchScreenshot(link, link.customScreenshotURL);
         } else if (link.searchTopSite && !link.isDefault) {
           this._tippyTopProvider.processSite(link);
@@ -422,24 +408,16 @@ this.TopSitesFeed = class TopSitesFeed {
           this._fetchIcon(link);
         }
 
         // Remove internal properties that might be updated after dispatch
         delete link.__sharedCache;
 
         // Indicate that these links should get a frecency bonus when clicked
         link.typedBonus = true;
-
-        if (amazonSearchTileOverrideURL) {
-          if (link.searchTopSite && link.label === "@amazon") {
-            delete link.searchTopSite;
-            delete link.label;
-            link.url = amazonSearchTileOverrideURL;
-          }
-        }
       }
     }
 
     return withPinned;
   }
 
   /**
    * Refresh the top sites data for content.