Index: chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerManager.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerManager.java b/chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerManager.java |
index 31e4aa42a3b16a93691970bc68f3e33f52e24399..e5eb34358b32777d778d3c3d9754d26b4fde6e2e 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerManager.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/banners/AppBannerManager.java |
@@ -11,7 +11,6 @@ import org.chromium.base.ApplicationStatus; |
import org.chromium.base.VisibleForTesting; |
import org.chromium.base.annotations.CalledByNative; |
import org.chromium.base.annotations.JNINamespace; |
-import org.chromium.chrome.R; |
import org.chromium.chrome.browser.ShortcutHelper; |
import org.chromium.chrome.browser.tab.EmptyTabObserver; |
import org.chromium.chrome.browser.tab.Tab; |
@@ -70,11 +69,9 @@ public class AppBannerManager extends EmptyTabObserver { |
* @param tab Tab that the AppBannerManager will be attached to. |
*/ |
public AppBannerManager(Tab tab, Context context) { |
- int iconSizePx = context.getResources().getDimensionPixelSize(R.dimen.app_banner_icon_size); |
- float density = context.getResources().getDisplayMetrics().density; |
- int iconSizeDp = (int) (iconSizePx / density); |
- |
- mNativePointer = nativeInit(iconSizeDp); |
+ mNativePointer = nativeInit( |
+ ShortcutHelper.getIdealSplashImageSizeInDp(context.getResources()), |
+ ShortcutHelper.getIdealIconSizeInDp(context.getResources())); |
mTab = tab; |
updatePointers(); |
} |
@@ -168,7 +165,7 @@ public class AppBannerManager extends EmptyTabObserver { |
} |
private static native boolean nativeIsEnabled(); |
- private native long nativeInit(int iconSize); |
+ private native long nativeInit(int idealSplashImageSizeInDp, int idealIconSizeInDp); |
private native void nativeDestroy(long nativeAppBannerManagerAndroid); |
private native void nativeReplaceWebContents(long nativeAppBannerManagerAndroid, |
WebContents webContents); |