Backed out changeset 8756322ebb4a (bug 1388396)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Wed, 13 Sep 2017 09:50:35 +0200
changeset 663819 540b7549aaa8318b955163249b106ff54e89163a
parent 663818 cae0b4b17d6595646502269ed291126269f0c447
child 663820 aa3158628f1a1d974a310477469bdd9359c529fe
push id79536
push userbmo:rchien@mozilla.com
push dateWed, 13 Sep 2017 12:07:56 +0000
bugs1388396
milestone57.0a1
backs out8756322ebb4a1ea6086ff0104d4abb4fd0100894
Backed out changeset 8756322ebb4a (bug 1388396)
mobile/android/base/java/org/mozilla/gecko/icons/IconRequest.java
mobile/android/base/java/org/mozilla/gecko/icons/IconRequestBuilder.java
--- a/mobile/android/base/java/org/mozilla/gecko/icons/IconRequest.java
+++ b/mobile/android/base/java/org/mozilla/gecko/icons/IconRequest.java
@@ -24,31 +24,29 @@ public class IconRequest {
     /* package-private */ String pageUrl;
     /* package-private */ boolean privileged;
     /* package-private */ TreeSet<IconDescriptor> icons;
     /* package-private */ boolean skipNetwork;
     /* package-private */ boolean backgroundThread;
     /* package-private */ boolean skipDisk;
     /* package-private */ boolean skipMemory;
     /* package-private */ int targetSize;
-    /* package-private */ int minimumSizePxAfterScaling;
     /* package-private */ boolean prepareOnly;
     private IconCallback callback;
 
     /* package-private */ IconRequest(Context context) {
         this.context = context.getApplicationContext();
         this.icons = new TreeSet<>(new IconDescriptorComparator());
 
         // Setting some sensible defaults.
         this.privileged = false;
         this.skipMemory = false;
         this.skipDisk = false;
         this.skipNetwork = false;
         this.targetSize = context.getResources().getDimensionPixelSize(R.dimen.favicon_bg);
-        this.minimumSizePxAfterScaling = 0;
         this.prepareOnly = false;
     }
 
     /**
      * Execute this request and try to load an icon. Once an icon has been loaded successfully the
      * callback will be executed.
      *
      * The returned Future can be used to cancel the job.
@@ -102,27 +100,16 @@ public class IconRequest {
     /**
      * Get the required target size of the icon.
      */
     public int getTargetSize() {
         return targetSize;
     }
 
     /**
-     * Gets the minimum size the icon can be before we substitute a generated icon.
-     *
-     * N.B. the minimum size is compared to the icon *after* scaling: consider using
-     * {@link org.mozilla.gecko.icons.processing.ResizingProcessor#MAX_SCALE_FACTOR}
-     * when setting this value.
-     */
-    public int getMinimumSizePxAfterScaling() {
-        return minimumSizePxAfterScaling;
-    }
-
-    /**
      * Should a loader access the network to load this icon?
      */
     public boolean shouldSkipNetwork() {
         return skipNetwork;
     }
 
     /**
      * Should a loader access the disk to load this icon?
--- a/mobile/android/base/java/org/mozilla/gecko/icons/IconRequestBuilder.java
+++ b/mobile/android/base/java/org/mozilla/gecko/icons/IconRequestBuilder.java
@@ -8,17 +8,16 @@ package org.mozilla.gecko.icons;
 import android.content.Context;
 import android.support.annotation.CheckResult;
 
 import org.mozilla.gecko.GeckoAppShell;
 
 import java.util.TreeSet;
 
 import ch.boye.httpclientandroidlib.util.TextUtils;
-import org.mozilla.gecko.icons.processing.ResizingProcessor;
 
 /**
  * Builder for creating a request to load an icon.
  */
 public class IconRequestBuilder {
     private final IconRequest internal;
 
     /* package-private */ IconRequestBuilder(Context context) {
@@ -102,26 +101,16 @@ public class IconRequestBuilder {
      * preferred Android launcher icon size.
      */
     public IconRequestBuilder forLauncherIcon() {
         internal.targetSize = GeckoAppShell.getPreferredIconSize();
         return this;
     }
 
     /**
-     * The icon will be used in Activity Stream: a minimum size for the icon will be set.
-     */
-    public IconRequestBuilder forActivityStream() {
-        // This value was set anecdotally: 16px icons scaled up both look blurry and
-        // don't fill the space well. 32px icons look good enough.
-        internal.minimumSizePxAfterScaling = 32 * ResizingProcessor.MAX_SCALE_FACTOR;
-        return this;
-    }
-
-    /**
      * Execute the callback on the background thread. By default the callback is always executed on
      * the UI thread in order to add the loaded icon to a view easily.
      */
     @CheckResult
     public IconRequestBuilder executeCallbackOnBackgroundThread() {
         internal.backgroundThread = true;
         return this;
     }
@@ -149,17 +138,16 @@ public class IconRequestBuilder {
         request.pageUrl = internal.pageUrl;
         request.privileged = internal.privileged;
         request.icons = new TreeSet<>(internal.icons);
         request.skipNetwork = internal.skipNetwork;
         request.backgroundThread = internal.backgroundThread;
         request.skipDisk = internal.skipDisk;
         request.skipMemory = internal.skipMemory;
         request.targetSize = internal.targetSize;
-        request.minimumSizePxAfterScaling = internal.minimumSizePxAfterScaling;
         request.prepareOnly = internal.prepareOnly;
         return request;
     }
 
     /**
      * This is a no-op method.
      *
      * All builder methods are annotated with @CheckResult to denote that the