Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5088)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java

Issue 2773353002: Make minimum PWA icon size the same accross all device densities
Patch Set: Merge branch 'master' into min_size Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
index c2bd1b22ea50f86be4547aafb5c02101c8b495c4..e441625e1eb23e55daaba513127183150d327684 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
@@ -525,20 +525,6 @@ public class ShortcutHelper {
}
/**
- * Returns the minimum size for an icon representing a web app. This size is used on app
- * banners, the Android Home screen, and in Android's recent tasks list, among other places.
- * @param context Context to pull resources from.
- * @return the lower bound of the size which the icon should have in pixels.
- */
- public static int getMinimumHomescreenIconSizeInPx(Context context) {
- float sizeInPx = context.getResources().getDimension(R.dimen.webapp_home_screen_icon_size);
- float density = context.getResources().getDisplayMetrics().density;
- float idealIconSizeInDp = sizeInPx / density;
-
- return Math.round(idealIconSizeInDp * (density - 1));
- }
-
- /**
* Returns the ideal size for an image displayed on a web app's splash screen.
* @param context Context to pull resources from.
* @return the dimensions in pixels which the image should have.
@@ -548,15 +534,6 @@ public class ShortcutHelper {
}
/**
- * Returns the minimum size for an image displayed on a web app's splash screen.
- * @param context Context to pull resources from.
- * @return the lower bound of the size which the image should have in pixels.
- */
- public static int getMinimumSplashImageSizeInPx(Context context) {
- return getSizeFromResourceInPx(context, R.dimen.webapp_splash_image_size_minimum);
- }
-
- /**
* Returns the ideal size for a badge icon of a WebAPK.
* @param context Context to pull resources from.
* @return the dimensions in pixels which the badge icon should have.
@@ -613,8 +590,8 @@ public class ShortcutHelper {
}
/**
- * Returns an array of sizes which describe the ideal size and minimum size of the Home screen
- * icon and the ideal and minimum sizes of the splash screen image in that order.
+ * Returns an array of sizes which describe the ideal sizes of the home screen, splash screen
+ * and badge icon respectively.
*/
@CalledByNative
private static int[] getHomeScreenIconAndSplashImageSizes() {
@@ -622,9 +599,7 @@ public class ShortcutHelper {
// This ordering must be kept up to date with the C++ ShortcutHelper.
return new int[] {
getIdealHomescreenIconSizeInPx(context),
- getMinimumHomescreenIconSizeInPx(context),
getIdealSplashImageSizeInPx(context),
- getMinimumSplashImageSizeInPx(context),
getIdealBadgeIconSizeInPx(context)
};
}

Powered by Google App Engine
This is Rietveld 408576698