Bug 1077032 - Fix blurry about:home icon in new tablet tab strip. r=lucasr
authorMichael Comella <michael.l.comella@gmail.com>
Thu, 23 Oct 2014 20:15:37 -0700
changeset 212133 5e380cbc4de65a5002de1e700b4e0d9878bab23b
parent 212132 25555c98f74cf3257d0e91dcc0f06379cae89ae2
child 212134 4c778609acfce98f5089760fdca03988e157eb51
push id27698
push usercbook@mozilla.com
push dateFri, 24 Oct 2014 13:53:50 +0000
treeherdermozilla-central@6e35802ae3e2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr
bugs1077032
milestone36.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 1077032 - Fix blurry about:home icon in new tablet tab strip. r=lucasr
mobile/android/base/favicons/Favicons.java
--- a/mobile/android/base/favicons/Favicons.java
+++ b/mobile/android/base/favicons/Favicons.java
@@ -463,26 +463,26 @@ public class Favicons {
         // ToolbarDisplayLayout), we can't.
         final int defaultFaviconDrawableID =
                 isNewTabletEnabled ? R.drawable.new_tablet_default_favicon : R.drawable.favicon;
         defaultFavicon = BitmapFactory.decodeResource(res, defaultFaviconDrawableID);
         if (defaultFavicon == null) {
             throw new IllegalStateException("Null default favicon was returned from the resources system!");
         }
 
-        // TODO: Remove this branch when old tablet is removed.
-        final int defaultFaviconSizeDimenID =
-                isNewTabletEnabled ? R.dimen.new_tablet_tab_strip_favicon_size : R.dimen.favicon_bg;
-        defaultFaviconSize = res.getDimensionPixelSize(defaultFaviconSizeDimenID);
+        defaultFaviconSize = res.getDimensionPixelSize(R.dimen.favicon_bg);
 
         // Screen-density-adjusted upper limit on favicon size. Favicons larger than this are
         // downscaled to this size or discarded.
-        largestFaviconSize = context.getResources().getDimensionPixelSize(R.dimen.favicon_largest_interesting_size);
+        largestFaviconSize = res.getDimensionPixelSize(R.dimen.favicon_largest_interesting_size);
 
-        browserToolbarFaviconSize = context.getResources().getDimensionPixelSize(R.dimen.browser_toolbar_favicon_size);
+        // TODO: Remove this branch when old tablet is removed.
+        final int browserToolbarFaviconSizeDimenID = NewTabletUI.isEnabled(context) ?
+                R.dimen.new_tablet_tab_strip_favicon_size : R.dimen.browser_toolbar_favicon_size;
+        browserToolbarFaviconSize = res.getDimensionPixelSize(browserToolbarFaviconSizeDimenID);
 
         faviconsCache = new FaviconCache(FAVICON_CACHE_SIZE_BYTES, largestFaviconSize);
 
         // Initialize page mappings for each of our special pages.
         for (String url : AboutPages.getDefaultIconPages()) {
             pageURLMappings.putWithoutEviction(url, BUILT_IN_FAVICON_URL);
         }