Bug 1266779 - Show placeholder icons in the search preferences for engines without icon, r=Gijs.
authorFlorian Quèze <florian@queze.net>
Mon, 25 Apr 2016 12:36:33 +0200
changeset 294734 a0868d83ff41797c0c1361d6fe6b8a6a41f048a3
parent 294731 1c6385ae1fe7e37d8f23f958ce14582f07af729e
child 294735 a1637276bacb44721a911b806fe4b37fb2554524
push id30210
push userkwierso@gmail.com
push dateMon, 25 Apr 2016 22:25:12 +0000
treeherdermozilla-central@79de998e7307 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1266779
milestone48.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 1266779 - Show placeholder icons in the search preferences for engines without icon, r=Gijs.
browser/components/preferences/in-content/search.js
--- a/browser/components/preferences/in-content/search.js
+++ b/browser/components/preferences/in-content/search.js
@@ -476,19 +476,25 @@ EngineView.prototype = {
   },
 
   // nsITreeView
   get rowCount() {
     return this._engineStore.engines.length;
   },
 
   getImageSrc: function(index, column) {
-    if (column.id == "engineName" && this._engineStore.engines[index].iconURI) {
-      return this._engineStore.engines[index].iconURI.spec;
+    if (column.id == "engineName") {
+      if (this._engineStore.engines[index].iconURI)
+        return this._engineStore.engines[index].iconURI.spec;
+
+      if (window.devicePixelRatio > 1)
+        return "chrome://browser/skin/search-engine-placeholder@2x.png";
+      return "chrome://browser/skin/search-engine-placeholder.png";
     }
+
     return "";
   },
 
   getCellText: function(index, column) {
     if (column.id == "engineName")
       return this._engineStore.engines[index].name;
     else if (column.id == "engineKeyword")
       return this._engineStore.engines[index].alias;