| 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 ecb2acdea553ba595f9bc8bddd9d754555f935c8..9bc0aa3f1937cf0aa24d3967a779dcb07f198a7d 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
|
| @@ -33,6 +33,7 @@ import org.chromium.base.Log;
|
| import org.chromium.base.VisibleForTesting;
|
| import org.chromium.base.annotations.CalledByNative;
|
| import org.chromium.chrome.R;
|
| +import org.chromium.chrome.browser.webapps.WebappDataStorage;
|
| import org.chromium.chrome.browser.webapps.WebappLauncherActivity;
|
| import org.chromium.chrome.browser.widget.RoundedIconGenerator;
|
| import org.chromium.content_public.common.ScreenOrientationConstants;
|
| @@ -40,7 +41,6 @@ import org.chromium.ui.widget.Toast;
|
|
|
| import java.io.ByteArrayOutputStream;
|
| import java.util.List;
|
| -import java.util.UUID;
|
|
|
| /**
|
| * This is a helper class to create shortcuts on the Android home screen.
|
| @@ -113,9 +113,9 @@ public class ShortcutHelper {
|
| */
|
| @SuppressWarnings("unused")
|
| @CalledByNative
|
| - private static void addShortcut(Context context, String url, String userTitle, String name,
|
| - String shortName, Bitmap icon, boolean isWebappCapable, int orientation, int source,
|
| - long themeColor, long backgroundColor) {
|
| + private static void addShortcut(Context context, String id, String url, String userTitle,
|
| + String name, String shortName, Bitmap icon, boolean isWebappCapable, int orientation,
|
| + int source, long themeColor, long backgroundColor) {
|
| Intent shortcutIntent;
|
| if (isWebappCapable) {
|
| // Encode the icon as a base64 string (Launcher drops Bitmaps in the Intent).
|
| @@ -131,7 +131,7 @@ public class ShortcutHelper {
|
| shortcutIntent = new Intent();
|
| shortcutIntent.setAction(sDelegate.getFullscreenAction());
|
| shortcutIntent.putExtra(EXTRA_ICON, encodedIcon);
|
| - shortcutIntent.putExtra(EXTRA_ID, UUID.randomUUID().toString());
|
| + shortcutIntent.putExtra(EXTRA_ID, id);
|
| shortcutIntent.putExtra(EXTRA_NAME, name);
|
| shortcutIntent.putExtra(EXTRA_SHORT_NAME, shortName);
|
| shortcutIntent.putExtra(EXTRA_URL, url);
|
| @@ -167,6 +167,16 @@ public class ShortcutHelper {
|
| }
|
|
|
| /**
|
| + * TODO(lalitm)
|
| + */
|
| + @SuppressWarnings("unused")
|
| + @CalledByNative
|
| + private static void addSplashscreenIconToWebappData(Context context,
|
| + String id, Bitmap splashIcon) {
|
| + WebappDataStorage.open(context, id).putSplashIcon(splashIcon);
|
| + }
|
| +
|
| + /**
|
| * Creates an intent that will add a shortcut to the home screen.
|
| * @param shortcutIntent Intent to fire when the shortcut is activated.
|
| * @param url URL of the shortcut.
|
|
|