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

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

Issue 1310223002: webapps: initial addition of splash screen icon downloading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webapps-database-exp
Patch Set: Fix compile Created 5 years, 3 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/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);

Powered by Google App Engine
This is Rietveld 408576698